[PyQt] Drop to system

Massimo Di Stefano massimodisasha at gmail.com
Thu Sep 9 14:29:48 BST 2010


Hello All,  David :-)


infinite thanks for your powerfull help !!!

i tried to apply little changes to the code, so now i'm able to drag n drop a QtLabel as a file.kml :-) :

-  http://www.geofemengineering.it/dragmime.py

tring to learn how to use the Drag class, i tried to hack the "draggabletext.py" from the pyqt source :

- http://www.geofemengineering.it/draggabletext_.py

i'm now blocked on how to reuse the same code 
to drag a QTableWidgetItem from a QtTablewidjet, 
the code i'm starting from is :

- http://www.geofemengineering.it/table_ui.py

- http://www.geofemengineering.it/table.py

i'm tring to learn how to use the class " bool QTableWidget::dropMimeData " have you any hints ?


thanks for your support !


Mssimo.




Il giorno 09/set/2010, alle ore 02.17, David Boddie ha scritto:

> On Wed Sep 8 22:33:17 BST 2010, Hugo Leveille wrote:
> 
>> I have looked at the doc but all I could find was drag and drop within the
>> pyqt app itself. What id like to do is the, for exemple, attach an url or
>> whatever needed to an item so that if I drag the item into my desktop, in a
>> explorer window or whatever othe app that support drag drop, it will
>> recongnize it
>> 
>> Some if anyone is nice enought to give me a quick exemple or to point me at
>> the specific exemple where it is shown, it would be very nice
> 
> It's been a while since I looked at this sort of thing, and the example I
> hoped would help me remember doesn't actually do anything with URLs...
> 
> You need to set the URL of the MIME data you create when you start a drag
> operation:
> 
> http://www.riverbankcomputing.com/static/Docs/PyQt4/html/qmimedata.html#setUrls
> 
> I seem to remember that you have to supply URLs for certain things to work
> on certain systems, and this may mean that you have to save data to a
> temporary file, then set the URL of that file, when filling in the MIME data.
> 
> Here is one way to do it that doesn't use a temporary file:
> 
> http://www.diotavelli.net/PyQtWiki/Exporting_a_file_to_other_applications
> 
> The Drop Site example in Qt is useful for looking at the MIME types of data
> dragged from other applications. It would be useful if someone ported that
> to PyQt.
> 
> David
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt



More information about the PyQt mailing list