Hi. How can I remove a list of selected items in the QListView in QT 4.6.?
Something like this does not work, the iterator becomes invalid:

Qt Code:
  1. QModelIndexList indexes = ui.listview_files->selectionModel()->selectedIndexes();
  2. foreach(QModelIndex index, indexes)
  3. {
  4. model->removeRow(index.row());
  5. }
To copy to clipboard, switch view to plain text mode 

removeRows also not suitable, it removes N-items that follows the one given.
I use QStandardItemModel to store items.