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

Internalize the screengrab that the attached Drag property does

    XMLWordPrintable

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

          For Gerrit Dashboard: QTBUG-117397
          # Subject Branch Project Status CR V

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change