[PyQt] QTreeWidget - drag&drop help

Baz Walter bazwal at ftml.net
Thu Oct 22 18:38:52 BST 2009


Taylor Carrasco wrote:
> For my QTreeWidget I'm still confused as to what to put in dropEvent()
> 
> Again, I only have event.accept() so far, and I can't figure out what else I
> need to make sure the row I'm dragged get's put into the row it supposed to,
> just as if I had never written the custom event in the first place.
> 
> def dropEvent(self, event):
>         print 'Drop pos: ', event.pos()
>         event.accept()

why are you trying to reimplement dropEvent? QTreeWidget has built in 
support for drag and drop. what is it that you can't do using the 
default implementation?



More information about the PyQt mailing list