diff options
Diffstat (limited to 'src/corelib/kernel/qmetatype.h')
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index d41f7ee80e..825f767425 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -572,7 +572,7 @@ public: static bool load(QDataStream &stream, int type, void *data); #endif - explicit QMetaType(const int type); // ### Qt6: drop const + explicit QMetaType(const int type = QMetaType::UnknownType); // ### Qt6: drop const inline ~QMetaType(); inline bool isValid() const; @@ -581,12 +581,24 @@ public: inline int sizeOf() const; inline TypeFlags flags() const; inline const QMetaObject *metaObject() const; + QT_PREPEND_NAMESPACE(QByteArray) name() const; inline void *create(const void *copy = nullptr) const; inline void destroy(void *data) const; inline void *construct(void *where, const void *copy = nullptr) const; inline void destruct(void *data) const; + template<typename T> + static QMetaType fromType() + { return QMetaType(qMetaTypeId<T>()); } + + friend bool operator==(const QMetaType &a, const QMetaType &b) + { return a.m_typeId == b.m_typeId; } + + friend bool operator!=(const QMetaType &a, const QMetaType &b) + { return a.m_typeId != b.m_typeId; } + + public: template<typename T> static bool registerComparators() @@ -1212,9 +1224,12 @@ public: { IteratorOwner<typename T::const_iterator>::assign(iterator, static_cast<const T*>(container)->find(*static_cast<const typename T::key_type*>(p))); } + QT_WARNING_PUSH + QT_WARNING_DISABLE_DEPRECATED // Hits on the deprecated QHash::iterator::operator--() template<class T> static void advanceImpl(void **p, int step) { std::advance(*static_cast<typename T::const_iterator*>(*p), step); } + QT_WARNING_POP template<class T> static void beginImpl(const void *container, void **iterator) |