I have a class derived from QFrame inside which I have an object of a class derived from QWidget.
______________________________________________________
| myFrameClass
: public QFrame| {
| Context Menu on RightClick defined here;
| myWidgetClass->setParent(this);
| }
| ______________________________________
| | myWidgetClass
: public QWidget |
| | { |
| | { |
| | e->ignore(); |
| | } |
| | } |
| |______________________________________|
|___________________________________________________
______________________________________________________
| myFrameClass : public QFrame
| {
| Context Menu on RightClick defined here;
| myWidgetClass->setParent(this);
| }
| ______________________________________
| | myWidgetClass : public QWidget |
| | { |
| | mousePressEvent( QMouseEvent e) |
| | { |
| | e->ignore(); |
| | } |
| | } |
| |______________________________________|
|___________________________________________________
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!
Bookmarks