[PyQt] Drag and drop files

Tina I tinaweb at bestemselv.com
Thu Jan 31 14:20:44 GMT 2008


non7top at gmail.com wrote:
> В сообщении от Wednesday 30 January 2008 13:09:00 Tina I написал(а):
>
>   
>> I'm stuck! Simply put I want to drop files into a QListView. I have been
>> reading TFM about QEvent but I don't understand what I'm reading (I'm
>> fairly new to programming) so I was hoping someone with too much time on
>> their hands would kickstart me a little. I just need some sample code to
>> point me in the right direction. I'm attaching a simple GUI that only
>> contain the ListView and a barebones .py to display it. Basically I just
>> want know how to catch the drop, atleast for now.
>>     
>
> Here's some code snippets from my app (self.ui.list_links is a QListWidget, 
> but i think that it would be same with QListView). Note that you should 
> reimplement both dragEnterEvent and dragMoveEvent (the letter is not required 
> for QLineEdit)
[snip]
Perfect! Thanks a million :)

Tina


More information about the PyQt mailing list