[PyQt] Drag and drop question

Robert Cheatham robertcheatham at gmail.com
Sun Jan 18 20:41:36 GMT 2009


I've got a couple QTreeWidget's in a dialog.  I want to be able to do drag
and drop operations between them, but to override the default drag and
drop.  The parent program/dialog will determine what effect the drop has.

The easiest and simplest way of doing this would be if I were able to
intercept a drop operation and have the following information:

1) Which QTreeWidget the drop happened on
2) Which QTreeWidgetItem (or index) and column the drop happened on
3) Which QTreeWidget the drag originated from
4) Which QTreeWidgetItems (or indices) were dragged


This seems like a really basic issue.  Shouldn't the QTreeWidget's dropEvent
function, instead of being of the form:

    "dropEvent (self, QDropEvent event)"

be of the form:

    dropEvent(self, QDropEvent event, QTreeWidgetItem *target, int
    targetColumn)

??????  Is there an easy way to do this?

Anyone know how to solve this issue?

Thanks,
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090118/929fba2b/attachment.html


More information about the PyQt mailing list