Hi Brothers

Why the code below does not work?I mean,only the frame is painted.
parallelMenu is a descendant of QWidget.
Qt Code:
  1. void parallelMenu::paintEvent(QPaintEvent *e)
  2. {
  3. QPainter p(this);
  4.  
  5. menuOpt.initFrom(this);//the rect is set in the constructor by setGeometry
  6.  
  7. QStyle *s=style();
  8.  
  9. s->drawPrimitive(QStyle::PE_PanelMenu,&menuOpt,&p);
  10. s->drawPrimitive(QStyle::PE_FrameMenu,&menuOpt,&p);
  11. }
To copy to clipboard, switch view to plain text mode