1
0
Fork 0

Improve performance for deselection a large amount

This commit is contained in:
ζeh Matt 2023-11-24 16:59:08 +02:00
parent 218d784a7e
commit 050c989dc3
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
1 changed files with 8 additions and 5 deletions

View File

@ -67,12 +67,15 @@ void PageMemoryRights::on_btnSelectall_clicked()
void PageMemoryRights::on_btnDeselectall_clicked()
{
QModelIndexList indexList = ui->pagetableWidget->selectionModel()->selectedIndexes();
foreach(QModelIndex index, indexList)
{
ui->pagetableWidget->selectionModel()->select(index, QItemSelectionModel::Deselect);
QModelIndexList selectedIndexes = ui->pagetableWidget->selectionModel()->selectedIndexes();
if(selectedIndexes.isEmpty())
return;
}
QModelIndex topLeft = selectedIndexes.first();
QModelIndex bottomRight = selectedIndexes.last();
QItemSelection selection(topLeft, bottomRight);
ui->pagetableWidget->selectionModel()->select(selection, QItemSelectionModel::Deselect);
}
void PageMemoryRights::on_btnSetrights_clicked()