When setting the current index through the related model's QItemSelectionModel::setCurrentIndex(), the selection can also change. However, attempting to shift-select after doing so would produce an unexpected selection, because the internal variable that keeps track of the start index of the current selection would still have its old value. This change moves where said variable is set: instead of doing that in QAbstractItemView::setCurrentIndex(), it is now done inside the currentChanged() slot instead. This slot will get called both when the selection is modified through the QAbstractItemView class itself, as well as when it's modified from the outside (e.g. from the model). Pick-to: 6.7 6.5 6.2 Fixes: QTBUG-127381 Change-Id: I6d38320e656aa5a102ce079604590672c88ecad1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit fb2d64bc57aadf5bf140c72cf7eb2a5f391b7d55) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%