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?

Qt Code:
  1. QList<QListWidgetItem*> selection = listWidget->selectedItems();
  2. int S = selection.size();
  3. std::vector<int> indices;
  4. 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