Apocalypse
12th September 2010, 21:45
How can I draw CE_MenuEmptyArea?
QPainter painter(this);
QStyleOptionMenuItem option;
option.initFrom(this);
option.rect=(0,0,100,100);
option.menuRect(0,0,100,100);
option.menuItemType=QStyleOptionMenuItem::EmptyAre a;
style()->drawControl(QStyle::CE_MenuEmptyArea, &option, &painter, this);
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?
QPainter painter(this);
QStyleOptionMenuItem option;
option.initFrom(this);
option.rect=(0,0,100,100);
option.menuRect(0,0,100,100);
option.menuItemType=QStyleOptionMenuItem::EmptyAre a;
style()->drawControl(QStyle::CE_MenuEmptyArea, &option, &painter, this);
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?