Important: Please read the Qt Code of Conduct -

Get file info when dropping a file in DropArea

  • Hi all,

    I have a DropArea in my QML app and I would like to drag and drop an external file in my app (in order to get the file path).
    The drop event works but I cannot find how to get file data from drop/drag event ...
    Any idea ?

    Rectangle {
    width: 300;
    height: 300;

        DropArea {
            id: dropArea;
            anchors.fill: parent;
            onDropped: {
                console.log ("onDropped");


  • I'm not sure if this is possible yet.
    See "bug report":

  • The DropArea component uses the QQuickDropEvent class which does not give access to mime data like the QDropEvent class does. Why don't you try creating your own custom qml component and override the dropEvent function which uses the QDropEvent class. That way you would have access to the file path.

Log in to reply