Reputation: 411
is it possible to enable Drag&Drop in QT applications? I mean I want to Drag any file to my application and I want to read its filename and path.
I have been watching examples of drag&drop searching for additional informations but I only figured out that drag&drop works between internal widgets of QT application.
Thanks in advance.
Upvotes: 1
Views: 1326
Reputation: 12832
For files dragged over your widget, the QMimeData will have urls which are paths to the files.
From http://doc.qt.io/qt-5/dnd.html#drag-and-drop-actions :
The other major use of drag actions is when using a reference type such as text/uri-list, where the dragged data are actually references to files or objects.
Upvotes: 3