diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-02-26 16:47:42 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-02-28 18:21:15 +0000 |
commit | 09bf5a439e62dbd9b634b912ba6895862e17105b (patch) | |
tree | bf7149d068e412cdccd1d569c70dde716bc9f904 /src | |
parent | dfa04903c6fc9d228dd52a7ec04d42a293cc2c6b (diff) |
QAbtractItemView: deselect before click opens editor
A click on the selected item should deselect all other items before
editing starts.
Remove the part of the test case that assumes that we can have multiple
items selected in ExtendedSelection mode, and click on an item to start
editing while maintaining selection. That can never happen.
Fixes: QTBUG-111131
Change-Id: I0312eed4614502cfb77eca26d3f7615427493d7d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 3f2d02e2f4436ace5f0fbbf432878a963f5ee969)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/itemviews/qabstractitemview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 3093c6ca3a..93672a24fc 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -1973,7 +1973,7 @@ void QAbstractItemView::mouseReleaseEvent(QMouseEvent *event) if (d->selectionModel && d->noSelectionOnMousePress) { d->noSelectionOnMousePress = false; - if (!edited && !d->pressClosedEditor) + if (!d->pressClosedEditor) d->selectionModel->select(index, selectionCommand(index, event)); } |