Reputation: 1258
I have a QTableView with its model which is QStandardItemModel. How can i make specific columns in tableView readOnly? It seems that i can't alter edit triggers of tableView since i want specific columns to be editable.
Upvotes: 1
Views: 2351
Reputation: 21258
You can try to set QStandardItem::setFlags()
for each item in that column, excluding Qt::ItemIsEditable
flag. For example:
[..]
QStandardItem *item = new QStandardItem;
item->setFlags(Qt::NoItemFlags);
[..]
Upvotes: 3