Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Remove multiple items from a view?

$
0
0
This is probably stupid question :) What is correct way of removing selected items from a view widget? Currently I’m coding the inelegant way. For example:     QModelIndexList selection = ui->tableView->selectionModel()->selection().indexes();     while(! selection.isEmpty())     {         QModelIndex i = selection.at(0);         this->model->removeRow(i.row(),i.parent()); // model is set for the view of course         selection = ui->tableView->selectionModel()->selection().indexes();     }

Viewing all articles
Browse latest Browse all 13965