Get target Object for drag and drop in QTreeWidget
I am currently working on dragging a treeWidgetItem to two different treeWidgets. Is there any way to let me get target treeWidget in dragMoveEvent(QDragMoveEvent *event) or other function when I am dragging a treeWidgetItem so that I can some animation effect to the target TreeWidget?
Also, can I get the itemIndex for the position of my mouse when I am dragging the item to another TreeWidget? Thank you very much.
Re: Get target Object for drag and drop in QTreeWidget
Not quite sure I understand you first question.
The "dragMoveEvent" handler is in your target class, no?
As for position: the event object has a position and the view has an indexAt() method.
Cheers,
_
Re: Get target Object for drag and drop in QTreeWidget
Quote:
Originally Posted by
anda_skoa
Not quite sure I understand you first question.
The "dragMoveEvent" handler is in your target class, no?
As for position: the event object has a position and the view has an indexAt() method.
Cheers,
_
The "dragMoveEvent" handler can be my target class but I can also use other class. Any suggestion?
Is there any way to directly get the target treeWidgetitem instead of comparing their position? Thank you.