Although it is pretty late to this thread, I am posting my solution in case I forget in future.
QModelIndexList indexlist = this->lastView->selectionModel()->selectedRows();
qSort(indexlist.begin(), indexlist.end(), qGreater<QModelIndex>()); // so that rows are removed from highest index
index.model()->removeRow(index.row());
}
QModelIndexList indexlist = this->lastView->selectionModel()->selectedRows();
qSort(indexlist.begin(), indexlist.end(), qGreater<QModelIndex>()); // so that rows are removed from highest index
foreach (QModelIndex index, indexlist) {
index.model()->removeRow(index.row());
}
To copy to clipboard, switch view to plain text mode
Bookmarks