diff options
Diffstat (limited to 'src/sql/models/qsqlquerymodel.cpp')
-rw-r--r-- | src/sql/models/qsqlquerymodel.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp index 864c5b9946..c0b1061c6b 100644 --- a/src/sql/models/qsqlquerymodel.cpp +++ b/src/sql/models/qsqlquerymodel.cpp @@ -212,6 +212,30 @@ bool QSqlQueryModel::canFetchMore(const QModelIndex &parent) const return (!parent.isValid() && !d->atEnd); } +/*! + \since 5.10 + \reimp + + Returns the model's role names. + + Qt defines only one role for the QSqlQueryModel: + + \table + \header + \li Qt Role + \li QML Role Name + \row + \li Qt::DisplayRole + \li display + \endtable +*/ +QHash<int, QByteArray> QSqlQueryModel::roleNames() const +{ + return QHash<int, QByteArray> { + { Qt::DisplayRole, QByteArrayLiteral("display") } + }; +} + /*! \internal */ void QSqlQueryModel::beginInsertRows(const QModelIndex &parent, int first, int last) |