Tony Cappellini  wrote / napísal(a):
> After looking through the examples & demos,  I don't see an example of what
> I'm looking for.
> 
> I would like to be able to drag a file or files onto a Python QT app, and
> have the app process the file(s).
> 
> The Draggable Icons example isn't quite the same. I want to drag a file
> from
> outside of the application, onto the running application.
> 
> Does anyone know where I can find an example to do this?

Dragging a file from outside of the application is not different than internal
drag&drop. Just setup the widget to accept drops and accept data with MIME type
"text/uri-list" in the handler. Probably the easiest way is to use methods
hasUrls and urls. QMimeData::urls returns a list of QUrl instances, use
toLocalFile to convert the URL to a local file name.

http://doc.trolltech.com/4.2/dnd.html#dropping
http://doc.trolltech.com/4.1/model-view-dnd.html#inserting-dropped-data-into-a-model

_______________________________________________
PyKDE mailing list    [email protected]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to