Archived:How to select multiple items with QListWidget
What needs to be done to enable multiple selection
The selectionMode() of a list widget determines how many of the items in the list can be selected at the same time, and whether complex selections of items can be created. This can be set with the setSelectionMode() function.
We associate itemClicked signal with corresponding slot.
connect(this, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(HandleItem()));
When an item is clicked then the HandleItem() slot is called. HandleItem() looks like this:
setCurrentRow(currentRow(), QItemSelectionModel::Toggle );
Sample code can be downloaded from the following zip file, It was tested with C7 Belle SW.
Download the example for Belle: File:ListWidgetMulti.zip