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();
}
↧