the PopMenu is a class derived the QMenu. In the contextMenuEvent of the DisplayWindow, the code is called . The menu is not immediately shown. After moved the mouse, then the menu will show. It's seem like a problem of render because the cpu is used for decoding the multi-channel
realtime stream & the gpu is used for rendering the YUV on the DisplayWindow at the same time. I find that if I reduce the channels from 8 to 6,the popmenu is immediately shown.


Qt Code:
  1. void DisplayWindow::contextMenuEvent (QContextMenuEvent *event)
  2. {
  3. QCursor cur = this->cursor();
  4. PopMenu *menu = new PopMenu(this);
  5. QAction* activeAction = menu->exec(cur.pos());
  6. }
To copy to clipboard, switch view to plain text mode 

.h file

Qt Code:
  1. class MyIconStyle : public QPlastiqueStyle
  2. {
  3. Q_OBJECT
  4. public:
  5. virtual int pixelMetric(PixelMetric metric, const QStyleOption * option, const QWidget * widget) const;
  6. };
  7.  
  8. class MyMenu : public QMenu
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit MyMenu(QWidget *parent);
  13.  
  14. protected:
  15. MyIconStyle *m_pMyStyle;
  16. };
  17.  
  18. class PopMenu : public MyMenu
  19. {
  20. Q_OBJECT
  21. public:
  22. explicit PopMenu(QWidget *parent);
  23. protected:
  24. QAction *action1;
  25. QAction *action2;
  26.  
  27. //sub_menus
  28.  
  29. QAction *sub_action_16[2];
  30. QAction *sub_action_24[2];
  31.  
  32. QLabel *label_title;
  33.  
  34. bool eventFilter(QObject *obj, QEvent *event);
  35.  
  36. public slots:
  37. void triggeredDeal(QAction *action);
  38. };
To copy to clipboard, switch view to plain text mode