Better way to do table not editable
--HG-- branch : develop
This commit is contained in:
parent
48bf54dfd9
commit
bc1664a275
|
@ -169,6 +169,7 @@ void DialogHistory::FillTable()
|
|||
QTableWidgetItem *item = new QTableWidgetItem(QString());
|
||||
item->setTextAlignment(Qt::AlignHCenter);
|
||||
item->setData(Qt::UserRole, tool.getId());
|
||||
item->setFlags(item->flags() ^ Qt::ItemIsEditable);
|
||||
ui->tableWidget->setItem(currentRow, 0, item);
|
||||
}
|
||||
|
||||
|
@ -177,9 +178,6 @@ void DialogHistory::FillTable()
|
|||
item->setFlags(item->flags() ^ Qt::ItemIsEditable);
|
||||
ui->tableWidget->setItem(currentRow, 1, item);
|
||||
++count;
|
||||
|
||||
item = ui->tableWidget->item(currentRow, 0);
|
||||
item->setFlags(item->flags() ^ Qt::ItemIsEditable);
|
||||
}
|
||||
}
|
||||
ui->tableWidget->setRowCount(count);//Real row count
|
||||
|
|
Loading…
Reference in New Issue
Block a user