diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index baf7ce81ec..aaf8142638 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -2957,6 +2957,15 @@ const char *QMetaProperty::typeName() const \sa type(), QMetaType, typeName(), metaType() */ +/*! \fn int QMetaProperty::typeId() const + \since 6.0 + + Returns the storage type of the property. This is + the same as metaType().id(). + + \sa QMetaType, typeName(), metaType() + */ + /*! \since 6.0 diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h index ca30815ec1..2cc334aff3 100644 --- a/src/corelib/kernel/qmetaobject.h +++ b/src/corelib/kernel/qmetaobject.h @@ -287,7 +287,8 @@ public: { int t = userType(); return t >= QMetaType::User ? QVariant::UserType : QVariant::Type(t); } QT_WARNING_POP #endif - int userType() const { return metaType().id(); } + int userType() const { return typeId(); } + int typeId() const { return metaType().id(); } QMetaType metaType() const; int propertyIndex() const; int relativePropertyIndex() const; diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 4b92da1ad4..810f4aac89 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -242,8 +242,9 @@ class Q_CORE_EXPORT QVariant inline void swap(QVariant &other) noexcept { qSwap(d, other.d); } - int typeId() const { return d.typeId(); } - int userType() const { return d.typeId(); } + int userType() const { return typeId(); } + int typeId() const { return metaType().id(); } + const char *typeName() const; QMetaType metaType() const;