diff options
Diffstat (limited to 'src/sql/kernel/qsqlerror.h')
-rw-r--r-- | src/sql/kernel/qsqlerror.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/sql/kernel/qsqlerror.h b/src/sql/kernel/qsqlerror.h index 6532f1af57..24f2921f5a 100644 --- a/src/sql/kernel/qsqlerror.h +++ b/src/sql/kernel/qsqlerror.h @@ -5,11 +5,13 @@ #define QSQLERROR_H #include <QtSql/qtsqlglobal.h> +#include <QtCore/qshareddata.h> #include <QtCore/qstring.h> QT_BEGIN_NAMESPACE class QSqlErrorPrivate; +QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QSqlErrorPrivate, Q_SQL_EXPORT) class Q_SQL_EXPORT QSqlError { @@ -25,16 +27,16 @@ public: const QString &databaseText = QString(), ErrorType type = NoError, const QString &errorCode = QString()); - QSqlError(const QSqlError& other); - QSqlError(QSqlError &&other) noexcept : d(other.d) { other.d = nullptr; } - QSqlError& operator=(const QSqlError& other); - QSqlError &operator=(QSqlError &&other) noexcept { swap(other); return *this; } - - bool operator==(const QSqlError& other) const; - bool operator!=(const QSqlError& other) const; + QSqlError(const QSqlError &other); + QSqlError(QSqlError &&other) noexcept = default; + QSqlError& operator=(const QSqlError &other); + QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QSqlError) ~QSqlError(); - void swap(QSqlError &other) noexcept { qt_ptr_swap(d, other.d); } + bool operator==(const QSqlError &other) const; + bool operator!=(const QSqlError &other) const; + + void swap(QSqlError &other) noexcept { d.swap(other.d); } QString driverText() const; QString databaseText() const; @@ -44,7 +46,7 @@ public: bool isValid() const; private: - QSqlErrorPrivate *d = nullptr; + QExplicitlySharedDataPointer<QSqlErrorPrivate> d; }; Q_DECLARE_SHARED(QSqlError) |