QAbstractItemView: Reset the drop indicator

Always reset the drop indicator position and rect when drag action will
be finished. This can prevent drawing the indicator in bad place when
the next drag will be performed.

Task-number: QTBUG-53541
Change-Id: I420207a0ede6f19f48472a8f0f723afe948de1c6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
This commit is contained in:
Błażej Szczygieł 2016-05-24 16:30:02 +02:00
parent b403b8c094
commit 1d9d165158

View File

@ -3620,6 +3620,9 @@ void QAbstractItemView::startDrag(Qt::DropActions supportedActions)
defaultDropAction = Qt::CopyAction; defaultDropAction = Qt::CopyAction;
if (drag->exec(supportedActions, defaultDropAction) == Qt::MoveAction) if (drag->exec(supportedActions, defaultDropAction) == Qt::MoveAction)
d->clearOrRemove(); d->clearOrRemove();
// Reset the drop indicator
d->dropIndicatorRect = QRect();
d->dropIndicatorPosition = OnItem;
} }
} }
#endif // QT_NO_DRAGANDDROP #endif // QT_NO_DRAGANDDROP