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?
You can find all QListWidgetItem* items you want to select and use QListWidgetItem::setSelected on them. This should support multiple selection if the list is configured for QAbstractItemView::ExtendedSelection.
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
Reference
In Qt Creator you find this option here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With