[SOLVED] How to disable Edit mode in the QTableView?

Issue

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?

Solution

Use the following:

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

Answered By – bruno

Answer Checked By – Clifford M. (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *