1
0
Fork 0

Optimize select all for the PageMemoryRights UI

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

View File

@ -55,14 +55,14 @@ void PageMemoryRights::RunAddrSize(duint addrin, duint sizein, QString pagetypei
void PageMemoryRights::on_btnSelectall_clicked()
{
for(int i = 0; i < ui->pagetableWidget->rowCount(); i++)
{
for(int j = 0; j < ui->pagetableWidget->columnCount(); j++)
{
QModelIndex idx = (ui->pagetableWidget->model()->index(i, j));
ui->pagetableWidget->selectionModel()->select(idx, QItemSelectionModel::Select);
}
}
const auto rowCount = ui->pagetableWidget->rowCount();
const auto columnCount = ui->pagetableWidget->columnCount();
QModelIndex topLeft = ui->pagetableWidget->model()->index(0, 0);
QModelIndex bottomRight = ui->pagetableWidget->model()->index(rowCount - 1, columnCount - 1);
QItemSelection selection(topLeft, bottomRight);
ui->pagetableWidget->selectionModel()->select(selection, QItemSelectionModel::Select);
}
void PageMemoryRights::on_btnDeselectall_clicked()