tags:

views:

48

answers:

1

I'm using QTableWidget as view widget and QTableWidgetItem as items. How to enable editing for specific QTableWidgetItem cells?

+1  A: 

Assuming that the QTableWidget is enabled, you just set the correct flags on the QTableWidgetItem.

Qt::ItemFlags flags = item->flags();
flags = bEnable ? flags | Qt::ItemIsEditable : flags & ~Qt::ItemIsEditable;
item->setFlags(flags);
David Walthall