diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-07-13 13:47:58 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-07-15 09:23:47 +0200 |
commit | cfb38538acbb600b828543a3d7892780b96a1f9a (patch) | |
tree | 91cc86152822f1c741f48e35b624e43930344b7a /src/qml/qml/qqmlerror.cpp | |
parent | 47bf186e0c5c14c47c0b090f52fd8c915b5ea85c (diff) |
Add equality operators for QQmlError and QQmlRefPointer
We need those to declare QProperties.
Change-Id: I49bf656607931e5d50f6a07cac92b7e176bb2b75
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlerror.cpp')
-rw-r--r-- | src/qml/qml/qqmlerror.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlerror.cpp b/src/qml/qml/qqmlerror.cpp index 706cc8601d..099dccd5d0 100644 --- a/src/qml/qml/qqmlerror.cpp +++ b/src/qml/qml/qqmlerror.cpp @@ -86,6 +86,12 @@ public: QtMsgType type = QtWarningMsg; int line = -1; int column = -1; + + friend bool operator==(const QQmlErrorPrivate &a, const QQmlErrorPrivate &b) + { + return a.url == b.url && a.object == b.object && a.message == b.message + && a.type == b.type && a.line == b.line && a.column == b.column; + } }; /*! @@ -298,6 +304,11 @@ QString QQmlError::toString() const return rv; } +bool operator==(const QQmlError &a, const QQmlError &b) +{ + return a.d == b.d || (a.d && b.d && *a.d == *b.d); +} + /*! \relates QQmlError \fn QDebug operator<<(QDebug debug, const QQmlError &error) |