diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-09-10 17:05:10 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-10-23 09:58:57 +0200 |
commit | 11bad6109606794091adc3b8a14070ac09707f45 (patch) | |
tree | 603d07bada752a534a8549c6d008b9b8a4aa832a /src/corelib/kernel/qmetaobject.cpp | |
parent | a618c260ed0d1de711a5bc20337f9b8c3835c407 (diff) |
Deprecate QVariant::Type
It's been obsolete for a long time already. Make sure
the compiler now warns about it and remove all remaining
uses in qtbase.
Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 3bb3e33465..1c9c684ef7 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -2941,21 +2941,16 @@ const char *QMetaProperty::typeName() const return rawTypeNameFromTypeInfo(mobj, data.type()); } -/*! +/*! \fn QVariant::Type QMetaProperty::type() const + \deprecated + Returns this property's type. The return value is one of the values of the QVariant::Type enumeration. - \sa userType(), typeName(), name(), metaType() + \sa metaType().id(), typeName(), name(), metaType() */ -QVariant::Type QMetaProperty::type() const -{ - uint type = userType(); - if (type >= QMetaType::User) - return QVariant::UserType; - return QVariant::Type(type); -} -/*! +/*! \fn int QMetaProperty::userType() const \since 4.2 Returns this property's user type. The return value is one @@ -2965,12 +2960,6 @@ QVariant::Type QMetaProperty::type() const \sa type(), QMetaType, typeName(), metaType() */ -int QMetaProperty::userType() const -{ - if (!mobj) - return QMetaType::UnknownType; - return QMetaType(mobj->d.metaTypes[data.index(mobj)]).id(); -} /*! \since 6.0 @@ -3197,7 +3186,7 @@ bool QMetaProperty::write(QObject *object, const QVariant &value) const QVariant v = value; QMetaType t(mobj->d.metaTypes[data.index(mobj)]); if (t != QMetaType::fromType<QVariant>() && t != v.metaType()) { - if (isEnumType() && !t.metaObject() && v.userType() == QMetaType::QString) { + if (isEnumType() && !t.metaObject() && v.metaType().id() == QMetaType::QString) { // Assigning a string to a property of type Q_ENUMS (instead of Q_ENUM) bool ok; if (isFlagType()) |