It seems that subclassing QSqlTableModel would be a good way to set some columns as Editable and others not, by reimplementing QSqlTableModel::data to control Qt::EditRole (is this a good idea?). In looking at the source I see that most methods in QSqlTableModel start with a line that is either "Q_D(QSqlTableModel);" or "Q_D(const QSqlTableModel);"; some start with "Q_Q(QSqlTableModel);", some don't have such a thing.

I cannot find documentation on this. What are they? If I subclass QSqlTableModel do I need to include them in my reimplementations of methods? If I create a new method how do I determine if I need one of these?

Thanks