Both the QGraphicsView and QGraphicsItem response to the mousePressEvent?
-
i overrider mousePressEvent for both QGraphicsView and QGraphicsItem to get mouse right button down event...but both of them get the event...and I just want the QGraphicsItem get the event...how to prevent it from the QGraphicsView?
ps. and I tried contextMenuEvent of the QGraphicsItem, it woks the same.
thank you -
When you reimplement the event handlers, the event is by default accepted and it does not propagates further. If you are reimplementing mousePress, also reimplement mouseRelease. Post your code if you still face the problem.
-
LIke I said, did you reimplemented the mouse release also? Do that and reply with the results.
-
Post some code here, so that we can get some idea of whats going wrong...
You may like to read this
http://blog.qt.digia.com/blog/2006/05/27/mouse-event-propagation/