QSqlTableModel
(or more generally QSqlQueryModel
) delegates query execution to QSqlQuery
. When results from query are received they are stored internally in form of a table with rows and columns and you can access them using QModelIndex
and QAbstractItemModel::data()
.
QSqlTableModel
itself is not SQL interpreter. Not at all. It doesn't provide any analysis routines for you. It isn't the purpose of this class. If you need analysis of data in the model, you have to write it yourself.