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

DropArea works incorrectly with file drops on Mac

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.0.0 Beta 1
    • Mac OS X 10.8
      gcc_64
      Qt 5.0 Beta 1 (official build from the website)
    • macOS

      It seems that DropArea component accepts local drag operations only. For example, the following app receives onEntered event only and drag.source property is null. Thus it's impossible to get the object being dragged.

      import QtQuick 2.0
      
      Rectangle {
          id: background;
          color: "white";
          width: 300;
          height: 300;
      
          DropArea {
              anchors.fill: parent;
              onEntered: {
                  background.color = "gray";
                  if (!drag.accepted)
                      drag.accept (Qt.CopyAction);
                  console.log("onEntered");
              }
              onDropped: {
                  console.log ("onDropped");
              }
              onExited: {
                  background.color = "white";
                  console.log ("onExited");
              }
          }
      }
      

      I suppose it may be a bigger problem since QWindow lacks setAcceptDrops function QMainWindow has. Since we're not able to use QQuickView inside QMainWindow it may be a serious problem.

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

            srutledg Shawn Rutledge
            chebum Ivan Nikitin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes