Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.0
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:
- Run the example
- 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
- relates to
-
QTBUG-72795 QtQuick Drag&Drop (Drag.automatic) regression: MouseRelease Event missing
- Closed
For Gerrit Dashboard: QTBUG-72417 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
260035,2 | Fix dnd regression c427ba53aa0ee1a71aa670783f65bcfd230da653 | 5.12 | qt/qtbase | Status: MERGED | +2 | 0 |