diff options
Diffstat (limited to 'src/corelib/kernel/qmetaobject_p.h')
-rw-r--r-- | src/corelib/kernel/qmetaobject_p.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h index 224c9d5354..d5dc9a356a 100644 --- a/src/corelib/kernel/qmetaobject_p.h +++ b/src/corelib/kernel/qmetaobject_p.h @@ -111,22 +111,18 @@ public: const_cast<QArgumentType *>(this)->_name = QMetaType(_type).name(); return _name; } - bool operator==(const QArgumentType &other) const - { - if (_type && other._type) - return _type == other._type; - else - return name() == other.name(); - } - bool operator!=(const QArgumentType &other) const + +private: + friend bool comparesEqual(const QArgumentType &lhs, + const QArgumentType &rhs) noexcept { - if (_type && other._type) - return _type != other._type; + if (lhs._type && rhs._type) + return lhs._type == rhs._type; else - return name() != other.name(); + return lhs.name() == rhs.name(); } + Q_DECLARE_EQUALITY_COMPARABLE(QArgumentType) -private: int _type; QByteArray _name; }; @@ -212,6 +208,11 @@ struct QMetaObjectPrivate int argc, const QArgumentType *types); static int indexOfConstructor(const QMetaObject *m, const QByteArray &name, int argc, const QArgumentType *types); + + enum class Which { Name, Alias }; + static int indexOfEnumerator(const QMetaObject *m, QByteArrayView name, Which which); + static int indexOfEnumerator(const QMetaObject *m, QByteArrayView name); + Q_CORE_EXPORT static QMetaMethod signal(const QMetaObject *m, int signal_index); static inline int signalOffset(const QMetaObject *m) { |