Standardize metaType stuff in QMetaProperty and QVariant

Change-Id: Idbb03d320039e8ddc4b7a7f42d2ba93ee47c456f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
David Skoland 2020-11-02 13:36:05 +01:00
parent 6032a9ca1a
commit 801e703a79
3 changed files with 14 additions and 3 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;