Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.4, 5.13.0
-
None
-
Dell XPS 15 9560, Windows 10
Description
In the attached sample application (based on externaldraganddrop example):
import QtQuick.Controls 2.4 import QtQuick 2.12 Rectangle { id: item property string display implicitWidth: 100 implicitHeight: 100 color: dropArea.containsDrag ? "#CFC" : "#EEE" ColorAnimation on color { id: rejectAnimation from: "#FCC" to: "#EEE" duration: 1000 } Text { anchors.fill: parent text: item.display wrapMode: Text.WordWrap } DropArea { id: dropArea anchors.fill: parent keys: ["text/plain"] onDropped: if (drop.hasText) { if (drop.proposedAction == Qt.MoveAction || drop.proposedAction == Qt.CopyAction) { console.debug("DropArea onDropped", "proposed:", drop.proposedAction, "supported:", drop.supportedActions, "action:", drop.action) item.display = drop.text drop.acceptProposedAction() } } } MouseArea { id: mouseArea anchors.fill: parent drag.target: draggable } Item { id: draggable anchors.fill: parent Drag.active: mouseArea.drag.active Drag.hotSpot.x: 0 Drag.hotSpot.y: 0 Drag.mimeData: { "text/plain": item.display } Drag.dragType: Drag.Automatic Drag.proposedAction: Qt.CopyAction Drag.supportedActions: Qt.CopyAction | Qt.MoveAction Drag.onDragStarted: { console.debug("Drag.onDragStarted"); } Drag.onDragFinished: { console.debug("Drag.onDragFinished dropAction:", dropAction) if (dropAction == Qt.MoveAction) item.display = "" } } }
There are two problems:
- If you drag text beetwen rectangles using touch on the touch screen, it happens that the drag does not work (hangs) until you move the mouse. This does not always occur but often. Certainly more than once in 10 times. Sometimes immediately. Additionally, you can see the warning: QML QQuickDragAttached: Binding loop detected for property "active". See the log for full view. Therefore, currently, unfortunately, it is not possible to stably drag mimeData using touch. The example does not use InputHandlers, which do not support DnD but MouseArea, where it should work with touch as well.
- Additionally, Drag.proposedAction seems to be ignored in DropArea. As long as Drag.supportedActions contains Qt.MoveAction drop.proposedAction will be Qt.MoveAction and not Qt.CopyAction as Drag wants. I think this is not correct. This error has nothing to do with touch.
Attachments
Issue Links
- relates to
-
QTBUG-106368 Wrong Usage of DoDragDrop() Causes Drag and Drop via Touch to Hang
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-77414 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
440596,1 | Windows QPA: Remove tablet->mouse synth and fix Drag&Drop with touch/pen | 6.3 | qt/qtbase | Status: NEW | +2 | 0 |