How to make a column in QTableWidget read only?

Insert into the QTableWidget following kind of items:

QTableWidgetItem *item = new QTableWidgetItem();
item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);

Works fine!

EDIT:

QTableWidgetItem *item = new QTableWidgetItem();
item->setFlags(item->flags() ^ Qt::ItemIsEditable);

This is a better solution. Thanks to @priomsrb.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)