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

Qml drag and drop: cursor shape does't change live

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.0
    • None
    • Linux/X11

    Description

      During drag, before dropping, the cursor shape does not change when proposed action changes.

      Using this slightly modified snippet I am logging proposed actions change when holding or releasing Ctrl and/or Shift keys, however the cursor shape does not change. Once dragging started, the cursor shape remains locked.

      import QtQuick
      
      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 | Qt.MoveAction
              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;
                          parent.Drag.active = true;
                      });
                  } else {
                      parent.Drag.active = false;
                  }
              }
          }
      
          DropArea {
              id: dropArea
              anchors.fill: parent
              onDropped: {
                  console.log("dropped", drop.proposedAction == Qt.MoveAction ? "move" : "copy");
              }
              onPositionChanged: {
                  console.log("dagging", drag.proposedAction == Qt.MoveAction ? "move" : "copy");
              }
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            svlasov Sergey Vlasov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes