Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QTableView - not allow user to edit cell

I created a QTableView with a QSqlTableModel. By standard, double-clicking on the cells will mark them and the user can edit them. I want, that the user isn't allowed to do that. He is allowed to mark the whole row by clicking on a single cell, but not to edit the cell. How can I do that?

like image 475
Berschi Avatar asked Aug 25 '09 14:08

Berschi


1 Answers

Try this:

table->setEditTriggers(QAbstractItemView::NoEditTriggers);
like image 97
shoosh Avatar answered Sep 30 '22 05:09

shoosh