Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to make te selected columns of QTableWidget as ReadOnly
Indrajeet last edited by
I have one table created using QTableWidget.
For this table I want odd column cells to be editable
& even column cells to be readOnly.
How to do this?
goetz last edited by
You can set the items in the even columns to read only like this:
QTableWidgetItem *twItem = tableWidget->item(3, 4);
twItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
// if you do not need selectable items this is ok:
Or set the flags during creation of the items, of course.