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:
QModelIndexList indexes = ui.listview_files->selectionModel()->selectedIndexes(); { model->removeRow(index.row()); }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.
Bookmarks