I do drag&drop between three QTreeWidgets; each tree are diffrent columns:
1) I do "copy" of drag item if d&d is between diffrent trees,
2) I do "move" if d&d is inside the same tree.
After drop I check if dropped item(s) below to dropped tree:
1) if item not below I know that it's "copy" so I add new item to the tree,
2) another way I know it's "move" so swap items positions.
I don't need remember in d&d mime hole dragged items, but only pointer to them, because it can be that some process in my application remove one of dragged item from tree when I do d&d (between time when I drag and time when I drop dragged item). If I know pointer I can check before drop item if it's still in one of trees. That's I need pointer. I thought about QPointer but QTreeWidgetItem is not "a child" of QObject.
I think also about QList<QTreeWidgetItem *>, but I can't read it form stream:
Qt Code:
QDataStream stream_items QList<QTreeWidgetItem *> items stream_items << items stream_items >> items // can't beTo copy to clipboard, switch view to plain text mode
Bookmarks