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

wrong position in mousePressEvent (different behavior between Qt 4 and Qt 5)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Duplicate
    • Affects Version/s: 5.3.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Mac OS X 10.9.4, various input deviced (Apple Magic Mouse, Apple Trackpad, Wacom Tablet).

      Description

      In Qt 4.x, a mouse press event always carries the position at which it occurred. If the application is busy at the time of the event, the event is delayed but still refers to the accurate mouse pointer position where the mouse press event originally occurred.

      In Qt 5.3, a mouse press event carries the position of the mouse pointer at the time when the event is delivered. If the application is busy when the user presses a mouse button and the mouse is moved after pressing the mouse button, this leads to mousePressEvents at locations where the user never pressed a mouse button.

      The attached minimalistic example can be compiled against Qt 4 or Qt 5.

      • Click quickly about 10 different positions in the Window, then rest the mouse pointer at the last position.
      • With Qt 4, the 10 clicked positions are correctly marked with a circle (the positions are also printed to stdout).
      • With Qt 5, the first one or two points appear about at the correct position, all other clicks are registeredon top of each other at the position where the mouse is currently resting. This creates mousePressEvents at locations where the user never clicked.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              sorvig Morten Sørvig
              Reporter:
              drew Drew
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes