Optimize select all for the PageMemoryRights UI
This commit is contained in:
parent
570aaea06d
commit
218d784a7e
|
@ -55,14 +55,14 @@ void PageMemoryRights::RunAddrSize(duint addrin, duint sizein, QString pagetypei
|
||||||
|
|
||||||
void PageMemoryRights::on_btnSelectall_clicked()
|
void PageMemoryRights::on_btnSelectall_clicked()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < ui->pagetableWidget->rowCount(); i++)
|
const auto rowCount = ui->pagetableWidget->rowCount();
|
||||||
{
|
const auto columnCount = ui->pagetableWidget->columnCount();
|
||||||
for(int j = 0; j < ui->pagetableWidget->columnCount(); j++)
|
|
||||||
{
|
QModelIndex topLeft = ui->pagetableWidget->model()->index(0, 0);
|
||||||
QModelIndex idx = (ui->pagetableWidget->model()->index(i, j));
|
QModelIndex bottomRight = ui->pagetableWidget->model()->index(rowCount - 1, columnCount - 1);
|
||||||
ui->pagetableWidget->selectionModel()->select(idx, QItemSelectionModel::Select);
|
|
||||||
}
|
QItemSelection selection(topLeft, bottomRight);
|
||||||
}
|
ui->pagetableWidget->selectionModel()->select(selection, QItemSelectionModel::Select);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageMemoryRights::on_btnDeselectall_clicked()
|
void PageMemoryRights::on_btnDeselectall_clicked()
|
||||||
|
|
Loading…
Reference in New Issue