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

MouseArea drag target becomes out of sync with cursor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P2: Important P2: Important
    • None
    • 6.8.0
    • None
    • Windows

      I would expect a MouseArea's drag.target to remain in sync with the cursor on dragging however if there is some main thread jank then they will become out of sync.
       
      Notice how in the below gif the cursor and the red target rectange are not in sync.

       
      Obviously ideally there would never be any main thread jank but in my case I update a QItemSelectionModel selected index in the MouseArea's onPressed call and this causes some other QML components to be created hanging the main thread briefly.
       
      I have not checked the code but I suspect the MouseArea start's applying the mouse cursor delta to the target item but if it applies the delta between the press event and the first drag event as well then it should remain in sync
       
      See the attached example project for a code example.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            haiku Ollie Dawes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes