[PyQt] QTreeWidget - drag&drop help

Taylor Carrasco crackerbunny at gmail.com
Tue Oct 20 23:36:53 BST 2009


> Just trying to do some simple drag drop calls with a QTreeWidget and
> getting nowheres....
>
> What am I missing in dropEvent to get it to actually copy the tree data
> into the new object?
> Currently the dragged object disappears after being dragged onto a new top
> level item, but doesn't show up in the tree.
>
>
>
> class DragDropListWidget(QTreeWidget):
>     def __init__(self, type, parent=None):
>         super(DragDropListWidget, self).__init__(parent)
>
>         #self.dropModes = self.supportedDropActions()
>         self.setAcceptDrops(True)
>         self.setDragDropMode(QAbstractItemView.InternalMove)
>         self.showDropIndicator()
>
>     def dragEnterEvent(self, event):
>         event.accept()
>
>     def dropEvent(self, event):
>         event.accept()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20091020/0abbf380/attachment.html


More information about the PyQt mailing list