If the user has selected multiple items in a QListWidget (contiguously or otherwise), is there any way to get a list (std::vector, preferably, or, better yet, an std::vector<bool> with 1's in the appropriate indices) of the selected rows without doing something like the following?
QList<QListWidgetItem*> selection = listWidget->selectedItems();
int S = selection.size();
std::vector<int> indices;
for(int i = 0; i < S; i++) indices.push_back(listWidget->row(selection[i]));
QList<QListWidgetItem*> selection = listWidget->selectedItems();
int S = selection.size();
std::vector<int> indices;
for(int i = 0; i < S; i++) indices.push_back(listWidget->row(selection[i]));
To copy to clipboard, switch view to plain text mode
virtual QModelIndexList QAbstractItemView::currentIndexes()
looks like it might be what I want, but it doesn't seem to be re-implemented for QListWidget or QListView
Bookmarks