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

Mac: Dragging an Item with Drag.dragType: Drag.Automatic does not send released signal on mouse up

    XMLWordPrintable

    Details

    • Platform/s:
      macOS

      Description

      When running the following example, wrong drag and drop behaviour can be observed along with a signal not being sent when it seems like it should:

      import QtQuick 2.9
      import QtQuick.Controls 2.2
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Dragging rectangle")
      
      
          Rectangle {
              id: dragRectangle
      
              Drag.source:    dragRectangle
              Drag.active:    dragMouseArea.drag.active
              Drag.dragType:  Drag.Automatic
      
              width: 64
              height: 64
              color: "orange"
      
              Text {
                  anchors.centerIn: parent
                  text: "Drag this"
              }
      
              MouseArea {
                  id: dragMouseArea
                  anchors.fill: parent
      
                  drag.target: dragRectangle
      
                  onReleased: {
                      console.log( "Mouse area released" )
                  }
              }
          }
      } 

      Steps to reproduce:

      1. Run the example
      2. Drag the orange rectangle somewhere in the window

      Expected behaviour

      The rectangle is moved to the new position on mouse up, and stays there until another drag is started. The dragMouseArea onReleased handler is called on mouse up.

      Actual behaviour

      The rectangle is moved to the new position on moving the mouse after the drag. The dragMouseArea onReleased handler is not called until you click and release again. The entire GUI is unresponsive until you click the mouse to trigger the mouse release signal.

      Additional information

      If you comment out the line Drag.dragType: Drag.Automatic then drag and drop works differently (as expected) but also the onReleased handler is now called on mouse up after the drag.

      I have tested this on older versions of Qt (5.9, 5.10, 5.11) and all of them work as expected.

      You can also see this broken behaviour when running the externaldraganddrop Qt example app http://doc.qt.io/qt-5/qtquick-externaldraganddrop-example.html

       

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              mikhailsvetkin Mikhail Svetkin
              Reporter:
              charles_auger Charles Auger
              Votes:
              12 Vote for this issue
              Watchers:
              19 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes