Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.11.2
-
None
-
macOS 10.13.6
Description
If you use the select function on a QAbstractItemView's SelectionModel in order to programmatically set an initial selection on e.g. a QListView, this item appears to be selected when the control is shown.
However, if you then hold Shift and click on another item in the list, you will find that all of the items in the list become selected rather than only the range between the programmatically selected item and the item you clicked on.
The attached trivial test application demonstrates this problem.
1. Open QListViewSelectionTest.pro in Qt Creator.
2. Build and run it.
3. When it runs, "Item 4" is selected in the list view.
4. Without clicking elsewhere in the list view, hold Shift and click on e.g. "Item 6".
EXPECTED: "Item 4", "Item 5" and "Item 6" are selected.
ACTUAL: All items in the list are selected.