Reputation: 1675
I am using QTableView. It's working fine. But the problem is that if I double click the cell then it changes into edit mode. I need to disable the edit option. How to do that?
Upvotes: 28
Views: 33809
Reputation: 14446
Use the editTriggers property
to change the behaviour.
All possible values are described here.
QTableView view();
view.setEditTriggers(QAbstractItemView::NoEditTriggers);
Upvotes: 4
Reputation: 2882
Use the following:
QTableView table(...);
table.setEditTriggers(QAbstractItemView::NoEditTriggers);
Upvotes: 60