Hi Brothers
Why the code below does not work?I mean,only the frame is painted.
parallelMenu is a descendant of QWidget.
{
menuOpt.initFrom(this);//the rect is set in the constructor by setGeometry
s
->drawPrimitive
(QStyle::PE_PanelMenu,
&menuOpt,
&p
);
s
->drawPrimitive
(QStyle::PE_FrameMenu,
&menuOpt,
&p
);
}
void parallelMenu::paintEvent(QPaintEvent *e)
{
QPainter p(this);
QStyleOptionMenuItem menuOpt;
menuOpt.initFrom(this);//the rect is set in the constructor by setGeometry
QStyle *s=style();
s->drawPrimitive(QStyle::PE_PanelMenu,&menuOpt,&p);
s->drawPrimitive(QStyle::PE_FrameMenu,&menuOpt,&p);
}
To copy to clipboard, switch view to plain text mode
Bookmarks