C++ – How to disable Edit mode in the QTableView

cqt

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?

Best Answer

Use the following:

QTableView table(...);
table.setEditTriggers(QAbstractItemView::NoEditTriggers);