aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-04-22 17:48:11 +0200
committerUlf Hermann <ulf.hermann@qt.io>2024-04-23 15:56:36 +0200
commit559cce11ee361446f04ba7a26606209a5aae52e4 (patch)
tree4c1f82853a51e9cb635759f3aed9dbbebb8bf030
parent6f3cb563eb94509b93e8c690e4d7efe7bbd99ed7 (diff)
QQmlType: Add missing operator!= and hide operator==
Change-Id: I3ed2f98b28bc4d8192e66de728869f296cb7f657 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r--src/qml/qml/qqmltype_p.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/qml/qml/qqmltype_p.h b/src/qml/qml/qqmltype_p.h
index ffffd0fdd9..622e91a4b2 100644
--- a/src/qml/qml/qqmltype_p.h
+++ b/src/qml/qml/qqmltype_p.h
@@ -51,10 +51,6 @@ public:
explicit QQmlType(const QQmlTypePrivate *priv);
~QQmlType();
- bool operator ==(const QQmlType &other) const {
- return d.data() == other.d.data();
- }
-
bool isValid() const { return !d.isNull(); }
QByteArray typeName() const;
@@ -176,6 +172,15 @@ public:
private:
friend class QQmlTypePrivate;
friend size_t qHash(const QQmlType &t, size_t seed);
+ friend bool operator==(const QQmlType &a, const QQmlType &b) noexcept
+ {
+ return a.d.data() == b.d.data();
+ }
+ friend bool operator!=(const QQmlType &a, const QQmlType &b) noexcept
+ {
+ return !(a == b);
+ }
+
QQmlRefPointer<const QQmlTypePrivate> d;
};