I mean what is the reason for trying to perform those drawing operations.
I mean what is the reason for trying to perform those drawing operations.
I want to draw menu using QStyle by using it's 'bricks':
http://doc.qt.nokia.com/4.6/style-reference.html#menus
But when I use drawPrimitive(QStyle::PE_PanelMenu,&menuOpt,&p); the panel is not drawn![]()
QMenu itself only draws PE_PanelMenu and CE_MenuItems, it doesn't call PE_FrameMenu.
Qt Code:
QStyleOptionMenuItem menuOpt; menuOpt.initFrom(this); menuOpt.maxIconWidth = 0; menuOpt.tabWidth = 0;To copy to clipboard, switch view to plain text mode
I tried this orginal QMenu code-it does not work.And about painting the frame-look down inside QMenu:aintEvent() :]
What do you mean it doesn't work?Try surrounding the call with QPainter::save() and QPainter::restore().
I mean that only the frame is visible,while I expected an plain,empty space.
Could you provide a mockup picture of what you wanted to obtain and what you did obtain?
Sure,there is is.
As you can see,element QStyle::CE_MenuEmptyArea,as well as QStyle::PE_PanelMenu is not drawn-only the frame is visible.
Although I managed to develop a solution at least-I draw a large QStyle::CE_MenuItem without neither text nor icon,and then paint test items on it.
But still,I don't know why the orginal code does not work.
At least for me the image is not helpful in any way, you provided an image of the whole screen and I wanted two small pictures one of which points to what you get and the other to what you would like to get.
Ok wysota,but in that case you have to wait 'till I come back from work to home.
Bookmarks