Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
To use the https://doc.qt.io/qt-6/qml-qtquick-drag.html#imageSource-attached-prop imageSource property, you usually need to use Item.grabToImage(), as shown. That's not declarative; and it also causes a race condition by being asynchronous. If you wait to start the screen-grab until it's time to actually start the drag, starting the drag should be delayed a little more until the screen grab is done.
So rather than this JS hassle, I think we need to add a QQuickItem* property (call it previewItem or so) which will be the same as the Item that the Drag is attached to, by default. If the user doesn't set imageSource, default behavior should be to automatically screen-grab the previewItem and use it for the "drag preview" (I googled and found https://react-spectrum.adobe.com/react-aria/dnd.html among other things, so I hope that's a term with some history behind it; ideally should research the history back to when DnD was invented, to check consensus for what this image is to be called).
Attachments
Issue Links
- relates to
-
QTBUG-120489 Drag.imageSource property should work with other images, not just screen grabs
- Closed
- resulted from
-
QTBUG-112673 Drag.imageSource example - no image on first drag
- Closed
-
QTBUG-115491 Drag.imageSource Only Works On Second try
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-117397 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
505684,1 | WIP internalize Drag screengrab | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |