I have a QListView and I have already set a model to it. How can I implement a method for invert selection?
I have already tried making a new QItemSelection
that contains all the items of my model in order to call ui.listView->selectionModel()->select(selection, QItemSelectionModel::Toggle);
but my QItemSelection
returns empty.
I have also thought of using the same method for each QModelIndex of my model, but I found no way to get a list of all QModelIndex
of my model.
Any ideas?