summaryrefslogtreecommitdiff
path: root/src/widgets/itemviews/qabstractitemview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews/qabstractitemview.cpp')
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 6799aa4ea6..f4f41e6f68 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -4028,6 +4028,11 @@ QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::extendedSelectionC
return QItemSelectionModel::Clear;
if (!index.isValid())
return QItemSelectionModel::NoUpdate;
+ // since the press might start a drag, deselect only on release
+ if (controlKeyPressed && !rightButtonPressed && pressedAlreadySelected
+ && dragEnabled && isIndexDragEnabled(index)) {
+ return QItemSelectionModel::NoUpdate;
+ }
break;
}
case QEvent::MouseButtonRelease: {
@@ -4040,6 +4045,10 @@ QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::extendedSelectionC
|| !index.isValid()) && state != QAbstractItemView::DragSelectingState
&& !shiftKeyPressed && !controlKeyPressed && (!rightButtonPressed || !index.isValid()))
return QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags();
+ if (index == pressedIndex && controlKeyPressed && !rightButtonPressed
+ && dragEnabled && isIndexDragEnabled(index)) {
+ break;
+ }
return QItemSelectionModel::NoUpdate;
}
case QEvent::KeyPress: {