PDA

View Full Version : QWidget not getting MouseButtonRelease event when embedded in QGraphicsScene



MSUdom5
15th April 2013, 22:23
I started a thread in the Qwt subforum about this issue, but I've since realized that the issue is not Qwt specific. My Qwt thread is here:

http://www.qtcentre.org/threads/54147-MouseEvent-issues-with-QwtPlot-inside-QGraphicsScene

I've embedded a QWidget in a QGraphicsScene, and I'm trying to handle the MouseButtonPress and MouseButtonRelease events. The QWidget gets all events except MouseButtonRelease. For some reason, it's not getting propagated to the QWidget when it's embedded in a QGraphicsScene. I've tested the other mouse and keyboard events, and they all get propagated to the QWidget just fine. What's special about MouseButtonRelease?

I'm using Qt 4.8 on Linux x86_64.

MSUdom5
16th April 2013, 16:14
Quick Update:

The QGraphicsProxyWidget is supposed to forward events to its child widget. It converts a QGraphicsSceneMouseEvent to a QMouseEvent, and passes it along to the widget. However, it seems that the mouseReleaseEvent function is never executed in my QGraphicsProxyWidget instance, so the event doesn't get passed to the underlying widget.

Anyone have any ideas?

MSUdom5
16th April 2013, 18:49
I found a solution. Please see my post in this thread:

http://www.qtcentre.org/threads/54147-MouseEvent-issues-with-QwtPlot-inside-QGraphicsScene