summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel/qsqlerror.h
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2017-04-27 18:44:19 +0200
committerJesus Fernandez <Jesus.Fernandez@qt.io>2017-04-28 12:50:34 +0000
commit99d809bd75582180a3a8178287862262024f8f33 (patch)
treef72bd51497c624df79702c0557014b4687b10f05 /src/sql/kernel/qsqlerror.h
parent7ef398e8fa7e283bf42eacfa9f0a514f6490aad2 (diff)
Add move special member functions to QSqlError
Also mark as shared-come-qt6 and add member-swap. [ChangeLog][QtSql][QSqlError] Added swap(). Coverity-Id: 168223 Change-Id: Iaad4dee383900b9d11856e860b0647780a81a505 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/sql/kernel/qsqlerror.h')
-rw-r--r--src/sql/kernel/qsqlerror.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sql/kernel/qsqlerror.h b/src/sql/kernel/qsqlerror.h
index 0ccd32159d..6dac47a7fe 100644
--- a/src/sql/kernel/qsqlerror.h
+++ b/src/sql/kernel/qsqlerror.h
@@ -66,11 +66,16 @@ public:
ErrorType type = NoError,
const QString &errorCode = QString());
QSqlError(const QSqlError& other);
+ QSqlError(QSqlError &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
QSqlError& operator=(const QSqlError& other);
+ QSqlError &operator=(QSqlError &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+
bool operator==(const QSqlError& other) const;
bool operator!=(const QSqlError& other) const;
~QSqlError();
+ void swap(QSqlError &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+
QString driverText() const;
QString databaseText() const;
ErrorType type() const;
@@ -102,6 +107,8 @@ private:
};
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QSqlError)
+
#ifndef QT_NO_DEBUG_STREAM
Q_SQL_EXPORT QDebug operator<<(QDebug, const QSqlError &);
#endif