PDA

View Full Version : QTreeView find out when the drag operation ends



mentalmushroom
30th September 2011, 10:51
Hi everybody out there! Is there any way to know when dragging some item of the tree view is finished? I see only QAbstractItemView::dropEvent, but I have to consider it can be canceled also. I need this to implement my own drop indicator, so I should know when to show it.

llev
3rd October 2011, 17:43
I guess drag-n-drop operation ends with one of the following events: QEvent::Drop and QEvent::DragLeave.
Did you check QEvent::DragLeave?

mentalmushroom
4th October 2011, 08:37
Thanks, it seems it is what I was searching for. I know this method, but qt docs tells "This function is called when the item being dragged leaves the view", so I thought it won't be called when a user presses escape or drops the item, but it actually does.