summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qmetaobject.cpp18
-rw-r--r--src/corelib/kernel/qmetaobject.h7
2 files changed, 25 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 2439c22f74..359dbfcf23 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1477,6 +1477,24 @@ bool QMetaObject::invokeMethod(QObject *obj,
invoked), otherwise returns false.
*/
+/*! \fn bool operator==(const QMetaMethod &m1, const QMetaMethod &m2)
+ \since 5.0
+ \relates QMetaMethod
+ \overload
+
+ Returns true if method \a m1 is equal to method \a m2,
+ otherwise returns false.
+*/
+
+/*! \fn bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2)
+ \since 5.0
+ \relates QMetaMethod
+ \overload
+
+ Returns true if method \a m1 is not equal to method \a m2,
+ otherwise returns false.
+*/
+
/*!
\fn const QMetaObject *QMetaMethod::enclosingMetaObject() const
\internal
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h
index 095b196dca..5204f04ca3 100644
--- a/src/corelib/kernel/qmetaobject.h
+++ b/src/corelib/kernel/qmetaobject.h
@@ -155,9 +155,16 @@ private:
friend struct QMetaObject;
friend struct QMetaObjectPrivate;
friend class QObject;
+ friend bool operator==(const QMetaMethod &m1, const QMetaMethod &m2);
+ friend bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2);
};
Q_DECLARE_TYPEINFO(QMetaMethod, Q_MOVABLE_TYPE);
+inline bool operator==(const QMetaMethod &m1, const QMetaMethod &m2)
+{ return m1.mobj == m2.mobj && m1.handle == m2.handle; }
+inline bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2)
+{ return !(m1 == m2); }
+
class Q_CORE_EXPORT QMetaEnum
{
public: