diff options
| author | Ivan Solovev <ivan.solovev@qt.io> | 2022-08-09 12:42:59 +0200 |
|---|---|---|
| committer | Ivan Solovev <ivan.solovev@qt.io> | 2022-08-10 22:38:24 +0200 |
| commit | 2ca30440835ef99d8b5f720866fc163a9629bed7 (patch) | |
| tree | 3d44c994a1f7dec26e5b732cfc4abfc7a244c0c1 /src/sql/models/qsqlquerymodel.cpp | |
| parent | 62859ccaa666909c2db8ac4d0a46fa0f5163153f (diff) | |
Make QSqlQueryModel::query() return a reference to the const QSqlQuery
Returning QSqlQuery instance by value does not make much sense,
because it cannot be copied correctly. Also, its copy constructor
and copy-assignment operators are deprecated from Qt 6.2.
[ChangeLog][Potentially Source-Incompatible Changes][QSqlQueryModel]
QSqlQueryModel::query() now returns a reference to the const QSqlQuery
object associated with the model.
Task-number: QTBUG-105048
Change-Id: I04a2aa377b17d770d2a9855040f8c730190484d8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/sql/models/qsqlquerymodel.cpp')
| -rw-r--r-- | src/sql/models/qsqlquerymodel.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp index 61620f81d45..fee99bd8eac 100644 --- a/src/sql/models/qsqlquerymodel.cpp +++ b/src/sql/models/qsqlquerymodel.cpp @@ -522,18 +522,15 @@ bool QSqlQueryModel::setHeaderData(int section, Qt::Orientation orientation, } /*! - Returns the QSqlQuery associated with this model. + Returns a reference to the const QSqlQuery object associated with this model. \sa setQuery() */ -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED -QSqlQuery QSqlQueryModel::query() const +const QSqlQuery &QSqlQueryModel::query(QT6_IMPL_NEW_OVERLOAD) const { Q_D(const QSqlQueryModel); return d->query; } -QT_WARNING_POP /*! Returns information about the last error that occurred on the |
