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

Qt6.5.1 QML - onDragFinished always gives dropAction equal to Qt::IgnoreAction on macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.5.1
    • GUI: Drag and Drop
    • None
    • macOS

    Description

      When I try doing a drag and drop of my own components from Qt/QML app and I drag the element to the desktop or any other application for Windows and Linux it gives the appropriate value for the drop. Whether it was cancelled or copied and so on, but for macOS it only gives that the event was cancelled even though the drop was a success and a copy was made 

      This is the code that is used

      Image {
      // Some other code

      Drag.dragType: Drag.Automatic
      Drag.supportedActions: Qt.CopyAction
      Drag.mimeData:

      {      "text/uri-list": includedFileItem.filePath }

      Drag.onDragFinished: function (dropAction) {
           if (dropAction || Qt.platform.os === "osx")

      {           console.log("Drag was a success")      }

           else

      {           console.log("Drag event was cancelled")      }

      }

      DragHandler {

           id: dragHandler

           onActiveChanged: if (active) {
                parent.grabToImage(function (result)

      {                parent.Drag.imageSource = result.url                parent.Drag.active = true            }

      )
           } else

      {             parent.Drag.active = false         }

           }
      }

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            d_poliigon Demjan Golubovski
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes