diff options
| author | Dheerendra Purohit <dheerendra@pthinks.com> | 2025-04-30 17:32:18 +0530 |
|---|---|---|
| committer | Dheerendra Purohit <dheerendra@pthinks.com> | 2025-07-04 18:32:23 +0530 |
| commit | 6733f3893caa2e195613690fccc5ec86fd8a118c (patch) | |
| tree | 383e71286452c325aedb95754b1ee6419a952d9f /src/sql/models/qsqlquerymodel.cpp | |
| parent | 54dc4c1b9f35fb19b94214f2e48ba518175f32b4 (diff) | |
QSqlQueryModel::setLastError should be const
The setLastError() function only modifies the mutable member d->error,
so it can safely be marked as const. This change allows setLastError()
to be called from other const member functions.
Fixes: QTBUG-136490
Change-Id: I62999a2696b1742208745890a76769f8977918cc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src/sql/models/qsqlquerymodel.cpp')
| -rw-r--r-- | src/sql/models/qsqlquerymodel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp index d8e10343854..6f4611d9139 100644 --- a/src/sql/models/qsqlquerymodel.cpp +++ b/src/sql/models/qsqlquerymodel.cpp @@ -561,9 +561,9 @@ QSqlError QSqlQueryModel::lastError() const \sa lastError() */ -void QSqlQueryModel::setLastError(const QSqlError &error) +void QSqlQueryModel::setLastError(const QSqlError &error) const { - Q_D(QSqlQueryModel); + Q_D(const QSqlQueryModel); d->error = error; } |
