Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QSqlTableModel read only
GrahamL last edited by
I have a QSqlTableModel which I use to populate a table view, but I need that some cells are read only.
In the past when I have used MV architecture I had my own model and overrode the
flagsmember to set an index as read only.
My aim is to have several views of the table (not necessarily table views) so I need the read only status to be in the model not the view.
I would be grateful if anyone has any suggestions as to how I can achieve this
You can to the same here, subclass QSqlTableModel and reimplement the flags function