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?
I created a QTableView with a QSqlTableModel. By standard, double-clicking on the cells will
Share
Depending on whether you are coding everything or doing things in the designer, set
editTriggerstoQAbstractItemView::NoEditTriggersselectionBehaviortoQAbstractItemView::SelectRowsselectionModetoQAbstractItemView::SingleSelectionif you want the user to select exactly one rowon the tableview object the appropriate calls will all be prefixed with
sete.gsetEditTriggers()in the Designer you can find these option in theAbstractItemViewsection