How to disable Edit mode in the QTableView?

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?

Answers


Use the following:

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

Try QAbstractItemView, which is the baseclass of QTableView where the EditTriggers enum (which NoEdittriggers is an element of) is declared. Taken from this link.

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

Use the editTriggers property to change the behaviour


Need Your Help

matplotlib - store image in variable

python html image matplotlib

I would like to store the image generated by matplotlib in a variable raw_data to use it as inline image.