Re: Advice on implementing user-checkable SQL model with specific field as check stat
Originally Posted by antimatter
That looks promising and would work -- if the QSqlQueryModel::data() would actually return data for the Qt::CheckStateRole.
Right, of course. You need to call the super class data() with a different role, e.g. DisplayRole or, maybe even better, EditRole.
Originally Posted by antimatter
So, I just call data() from QSqlQueryModel, but when I need the CheckStateRole, I call data() again with DisplayRole, but with a modified index to look at another column where the checkstate actually is.
Ah. Your original posting's screenshot had it in the first column.
Bookmarks