[PyQt] How to get the widget in a QTreeWidget where a drop occurred

Marc Nations mnations.lists at gmail.com
Tue Feb 3 17:24:35 GMT 2009


Hi,
My app requires a drag/drop from one tree to another. I have overriden the
drop method to put in my own functionality which a Tree Widget that I have
sub-classed. So far I've been able to get it working like I need; however
that has been mainly by rebuilding the tree based on which selections were
made in the source tree. In this scenario I don't care where it's dropped.

However, now I need to add in the ability to drop the items in the area
selected, so somehow I need to get the TreeWidgetItem onto which it was
dropped. I've looked at the event info and other areas surrounding the drop
functionality but can't seem to find it.

I'm having to work around using the mime data, because I have not been
successful getting that information to pass through. As a result, everything
I do is based on selections highlighted in the source tree. So hopefully I
don't need that to get the info. How do I find out where it was dropped?

Thanks,
Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090203/5f01f6e1/attachment.html


More information about the PyQt mailing list