Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Set Flags with QSqlModel
ankit thakar last edited by
I have used Table View and QSqlModel in my code.
Now In my table view I want to enable or disable some cells on basis of some check.
I found that with QTableModel we can easily set Flags and on basis of that it will enable or disable particular cells.
But how to do this same with QSqlModel ???
Subclass QSqlTableModel and reimplement the flags method.
VRonin last edited by
Or just use a proxy on top of the model, here is an example of proxy that lets you set flag for columns, rows or individual cells.
- I used QSortFilterProxyModel as base as I use the base class capabilities but QIdentityProxyModel works as well as base
- My implementation works only with flat models (no trees structure)