aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlerror.h
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2022-04-07 10:07:07 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2022-04-08 00:20:10 +0200
commit54a71e8c83de9b0312c920bc52378efcf20d537b (patch)
tree3906653c53aed828e06b47066617a46f4688c490 /src/qml/qml/qqmlerror.h
parentf8c94e4c01795f00934d5a98656f340a105de194 (diff)
Make QQmlError movable
This silences a code-checker warning, and is a good idea in general. Change-Id: I79642d57e53d4be7312e9066f72c2a069f079bca Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlerror.h')
-rw-r--r--src/qml/qml/qqmlerror.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlerror.h b/src/qml/qml/qqmlerror.h
index 53a28b244b..bb24717714 100644
--- a/src/qml/qml/qqmlerror.h
+++ b/src/qml/qml/qqmlerror.h
@@ -47,7 +47,7 @@
QT_BEGIN_NAMESPACE
-// ### Qt 6: should this be called QQmlMessage, since it can have a message type?
+// ### Qt 7: should this be called QQmlMessage, since it can have a message type?
class QDebug;
class QQmlErrorPrivate;
class Q_QML_EXPORT QQmlError
@@ -55,9 +55,17 @@ class Q_QML_EXPORT QQmlError
public:
QQmlError();
QQmlError(const QQmlError &);
+ QQmlError(QQmlError &&other) noexcept
+ : d(std::exchange(other.d, nullptr))
+ {}
+
QQmlError &operator=(const QQmlError &);
+ QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QQmlError)
~QQmlError();
+ void swap(QQmlError &other)
+ { qt_ptr_swap(d, other.d); }
+
bool isValid() const;
QUrl url() const;