It's possible to select a single item/row, but I want to set multiple items selected (the widget is configured to allow that). Is it possible?
7
votes
2 Answers
15
votes
2
votes
I've found this question while looking for the same answer. However, I am using Python (PyQt5) with Qt Creator.
Using PyQt5 you can set the SelectionMode by using:
from PyQt5 import QtWidgets
QtWidgets.QListWidget.setSelectionMode(2)
where
- SelectionMode = 0 => NoSelection
- SelectionMode = 1 => SingleSelection
- SelectionMode = 2 => MultiSelection
- SelectionMode = 3 => ExtendedSelection
- SelectionMode = 4 => ContiguousSelection