Get file info when dropping a file in DropArea
-
wrote on 3 Apr 2013, 14:08 last edited by
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"); console.log(drag); console.log(drop); } } }
@
-
wrote on 14 Apr 2013, 21:21 last edited by
I'm not sure if this is possible yet.
See "bug report":https://bugreports.qt-project.org/browse/QTBUG-27125 -
wrote on 15 Apr 2013, 23:28 last edited by
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.