Results 1 to 5 of 5

Thread: CE_MenuEmptyArea problem drawing

  1. #1
    Join Date
    Mar 2008
    Location
    Ukraine, Donetsk
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default CE_MenuEmptyArea problem drawing

    How can I draw CE_MenuEmptyArea?

    Qt Code:
    1. QPainter painter(this);
    2. option.initFrom(this);
    3. option.rect=(0,0,100,100);
    4. option.menuRect(0,0,100,100);
    5. option.menuItemType=QStyleOptionMenuItem::EmptyArea;
    6. style()->drawControl(QStyle::CE_MenuEmptyArea, &option, &painter, this);
    To copy to clipboard, switch view to plain text mode 

    I ran this code with different styles with no success.
    And there is often "break;" in cases of CE_MenuEmptyArea in different styles' sources.
    May it be incorrect way to draw plain menu area?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: CE_MenuEmptyArea problem drawing

    You find a break since normal style won't draw anything in an empty area of the menu bar. You are looking for QStyle::PE_PanelMenuBar with QStyle::drawPrimitive(), I guess.

  3. #3
    Join Date
    Mar 2008
    Location
    Ukraine, Donetsk
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: CE_MenuEmptyArea problem drawing

    No, The problem that I'm looking for menu empty area, not menubar one.
    But I wouldn't be suprised if styles can't draw such things directly

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: CE_MenuEmptyArea problem drawing

    Sorry, I misunderstood you. After a quick research I am also confused. I bet you are right and CE_MenuEmptyArea is simply left empty that the normal background of the menu panel is used.

  5. #5
    Join Date
    Mar 2008
    Location
    Ukraine, Donetsk
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: CE_MenuEmptyArea problem drawing

    And how is menu drawn? Item by Item? But I also couldn't get any plain menu item to draw

Similar Threads

  1. Problem with drawing on the Widget
    By kaszewczyk in forum Newbie
    Replies: 4
    Last Post: 17th April 2010, 15:00
  2. problem in drawing image in QLabel!
    By mismael85 in forum Qt Programming
    Replies: 2
    Last Post: 28th March 2010, 15:16
  3. Drawing problem
    By boss_bhat in forum Qt Programming
    Replies: 18
    Last Post: 28th January 2007, 11:26
  4. QPainterPath drawing problem
    By shad in forum Qt Programming
    Replies: 3
    Last Post: 17th January 2007, 13:30
  5. drawing problem
    By boss_bhat in forum Newbie
    Replies: 1
    Last Post: 20th September 2006, 10:49

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.