I have a class derived from QFrame inside which I have an object of a class derived from QWidget.
Qt Code:
  1. ______________________________________________________
  2. | myFrameClass : public QFrame
  3. | {
  4. | Context Menu on RightClick defined here;
  5. | myWidgetClass->setParent(this);
  6. | }
  7. | ______________________________________
  8. | | myWidgetClass : public QWidget |
  9. | | { |
  10. | | mousePressEvent( QMouseEvent e) |
  11. | | { |
  12. | | e->ignore(); |
  13. | | } |
  14. | | } |
  15. | |______________________________________|
  16. |___________________________________________________
To copy to clipboard, switch view to plain text mode 

I have defined a context-menu to appear when I right-click on myFrameClass. And I have explicitly overridden the mousePressEvent inside myWidgetClass. In spite of this, when I right-click on myWidgetClass, the context-menu of myFrameClass pops up . I dont understand, why, if I have overridden to ignore the mousePressEvent, should the mousePressEvent go to the parent (myFrameClass)?

Any pointers would be appreciated!
Tnx in adv!