[PyQt] Droping files over a QWidget

Nahuel Defossé nahueldefosse at yahoo.com.ar
Sun May 20 00:27:10 BST 2007


Thanks!

The fridge magnets sample that came with PyQt4 instalation had the necessary 
methods.
But the sample doesn't work in Windows 
I don't care much about it, but it would be nice to know it I can make it work 
under win... mostly because a big part of my friend still use that OS.
In kde, i can get the full path from every file or folder i drop inside the 
QWidget. I didn't try under GNOME or XFCE.

El Friday 18 May 2007 14:39:56 David Boddie escribió:
> On Fri May 18 03:57:43 BST 2007, Nahuel Defossé wrote:
> > I'm learning Python and PyQt, I come from Java and C/C++.
> > I found PyQt very fast and effective but there's something that's killing
> > my brain. I'm trying to drop a file in a QWidget, i'm just interested
> > about getting the path. It's a file conversion tool.
> > I've implemented dropEvent, and set to Ture acceptDrops, but aparenty the
> > function never get invoked...
> > Can QWidgets recive desktop drops?
>
> Yes, you just need to implement dragEnterEvent() and accept the drops you
> are interested in:
>
>   http://doc.trolltech.com/4.2/dnd.html
>
> You may find it useful to look at some of the examples in the PyQt
> distribution.
>
> David
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt



More information about the PyQt mailing list