Wait, are you using QWidget::mousePressEvent() or QWidget::contextMenuEvent() to show the context menu? It should be the latter. Accepting an event stops the event propagation.
Wait, are you using QWidget::mousePressEvent() or QWidget::contextMenuEvent() to show the context menu? It should be the latter. Accepting an event stops the event propagation.
J-P Nurmi
The code for showing the Context-Menu is implemented using mousePressEvent(). It's not my code ownership and is already existing so cant do much about it.
But here the case is different I think. Coz the child object is myWidgetClass and the parent is myFrameClass. And in myWidgetClass I _am_ accepting() the event so meanging which it should not propagate further to its parent, right?
Anyway, I'm looking into eventFilter(QObject *obj, QEvent *event) now. Hope I find something useful!
This works quite well for me, so you must have messed something up.
Please note that this approach is the worst you could take. The best would be to use the context menu event and a worse but still better than using mousePress is to use mouseReleaseEvent.
viking (9th May 2007)
Bookmarks