Details
-
Bug
-
Resolution: Out of scope
-
P4: Low
-
4.2.2
-
None
Description
The widget position reported in mouseReleaseEvent() may be offset by some value in some cases, this happens when you have a widget hierarchy such as follows:
QWidget
-> QFrame
-> QLabel
where the QLabel is a child of QFrame, which in turn is a child of QWidget. The QFrame is not in a layout.
When clicking on the QLabel the mouse events are propagated up to the QWidget, and in the mousePressEvent() function of the QWidget, the QFrame is hidden. When moving the mouse, events are still dispatched to the QLabel, and in the mouseReleaseEvent() the position reported by QMouseEvent::pos() will be offset exponentally relative to where in the QLabel the mouse was initially pressed.
Also worth noting is that it's kinda odd that the implicitly hidden QLabel still gets event dispatched to it. This does not happen if the QLabel is hidden explicitly.
Not been able to track down what is going wrong in this case, but it seems related to the fact that qt_button_down widget pointer does not get reset to 0 when a parent of the qt_button_down widget is hidden.