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:
QModelIndexList indexes = ui.listview_files->selectionModel()->selectedIndexes();
foreach(QModelIndex index, indexes)
{
model->removeRow(index.row());
}
removeRows also not suitable, it removes N-items that follows the one given. I use QStandardItemModel to store items.