Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-466

The widget position reported in mouseReleaseEvent() may be offset by some value in some cases

    XMLWordPrintable

Details

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bhughes Bradley T. Hughes (closed Nokia Identity) (Inactive)
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes