tags:

views:

288

answers:

1

Hi fellows!

Qt4 has support for Drag & Drop actions and I've used them like in the tutorial. Now I want to be able to drag external elements (files) into the GUI form and perform actions based on that (like get the full path and copy it somewhere).

I'm not sure whether this is a limitation like something Qt cannot do. Does someone know how you can do that with Qt? Simply drag a file into a GUI...

Thanks, Marius

+2  A: 

Most file managers provide drag-and-drop data using the text/uri-list target.

Regarding the linked tutorial, first you need to set the widget to accept dropping text/uri-list data, then you can retrieve the URIs by calling event.mimeData().urls(). The return value is a list of QUrl objects.

Johannes Sasongko
Thanks URI was the term I should have searched!
wishi