Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.0
-
None
-
Windows 11 22H2 (Build 22621.1413)
Qt 6.5.0/6.4.2
ninja 1.11.0
cmake 3.24.2
-
-
a3dea1b4f (dev), 85f6ffc9b (6.6), 9d1e8deef (tqtc/lts-6.5), b09d82e6f (tqtc/lts-6.2)
Description
The following example from the documentation does not work as expected.
The image of the dragged item only is not visible on the first drag, after that first drag it is always visible.
import QtQuick 2.12 Item { width: 200; height: 200 Rectangle { anchors.centerIn: parent width: text.implicitWidth + 20; height: text.implicitHeight + 10 color: "green" radius: 5 Drag.active: dragHandler.active Drag.dragType: Drag.Automatic Drag.supportedActions: Qt.CopyAction Drag.mimeData: { "text/plain": "Copied text" } Text { id: text anchors.centerIn: parent text: "Drag me" } DragHandler { id: dragHandler onActiveChanged: if (active) { parent.grabToImage(function(result) { parent.Drag.imageSource = result.url; }) } } } }
It also tested the same way on Qt 6.4.2.
Maybe the example is meant to show that this does not work:
Changing this property after the drag operation has started will have no effect.
Attachments
Issue Links
- is duplicated by
-
QTBUG-115491 Drag.imageSource Only Works On Second try
- Closed
- resulted in
-
QTBUG-117397 Internalize the screengrab that the attached Drag property does
- Reported