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

QtQuick dragging: Mouse cursor is off while dragging item

    XMLWordPrintable

Details

    • 528b720d8f25c851b5e73b4159c20d70a47aefc0

    Description

      When dragging an item using the Drag API in QtQuick, the mouse cursor position is off.

      This is hard to describe in words, but let me try:

      In QtWidget land, the drag behavior basically follows this principle (easy to verify by dragging some widgets in a QtDesigner form):

      1) Mouse press and hold
      2) Move cursor
      3) Eventually Qt interprets mouse move as drag
      4) Underlying item is immediately moved to the mouse position when a drag is registered
      5) Underlying item is further moved in sync with the mouse cursor

      In QtQuick, this is slightly different:
      Basically, step (4) is missing here.
      Because of this, the cursor is off when further dragging the item.

      Attached the slightly modified example from http://qt-project.org/doc/qt-5/qml-qtquick-drag.html#details.

      How to reproduce:
      Drag the red rectangle about (50,50) pixels

      What I'd expected as example output:
      press: 5, 6
      release: 5, 6

      But what you get is something along:
      press: 5, 6
      release: 10, 17

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-38539
          # Subject Branch Project Status CR V

          Activity

            People

              krf Kevin Funk
              krf Kevin Funk
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes