You can use QSqlQueryModel::record() or headerData() for this.