viking
8th May 2007, 07:43
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 |
| | { |
| | mousePressEvent( QMouseEvent e) |
| | { |
| | e->ignore(); |
| | } |
| | } |
| |______________________________________|
|_________________________________________________ __
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:eek: . :confused: I dont understand, why, if I have overridden to ignore the mousePressEvent, should the mousePressEvent go to the parent (myFrameClass)? :confused:
Any pointers would be appreciated!
Tnx in adv!
__________________________________________________ ____
| myFrameClass : public QFrame
| {
| Context Menu on RightClick defined here;
| myWidgetClass->setParent(this);
| }
| ______________________________________
| | myWidgetClass : public QWidget |
| | { |
| | mousePressEvent( QMouseEvent e) |
| | { |
| | e->ignore(); |
| | } |
| | } |
| |______________________________________|
|_________________________________________________ __
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:eek: . :confused: I dont understand, why, if I have overridden to ignore the mousePressEvent, should the mousePressEvent go to the parent (myFrameClass)? :confused:
Any pointers would be appreciated!
Tnx in adv!