path: root/src/corelib/kernel/qmetaobject.cpp
diff options
authorFabian Kosmale <>2020-11-18 16:35:20 +0100
committerFabian Kosmale <>2020-11-30 17:16:21 +0100
commitd27d2b5d72acb2a3be55d0af9ded4cd126a5f031 (patch)
tree3bfeee6cf74782a197db3c604367e63031528ede /src/corelib/kernel/qmetaobject.cpp
parent26e1a0997e1494433e43355cb56c05543ac56b5c (diff)
QMetaProperty::typeName: use name from metatype
Except for types marked as unresolved, we're doing it anyway - the only difference is that now we skip looking up the metatype by typeid. [ChangeLog][QMetaProperty][Important Behavior Change] QMetaProperty::typeName returns now always the same name as name() of the corresponding metatype. This can cause a change for enum properties which were not fully-qualified. Change-Id: I1f57743948b7262ac06095d3bbc838d620f6e481 Reviewed-by: Qt CI Bot <> Reviewed-by: Lars Knoll <> Reviewed-by: Ulf Hermann <>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index aaf8142638..fe6b4075ef 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -2934,6 +2934,9 @@ const char *QMetaProperty::typeName() const
if (!mobj)
return nullptr;
+ // TODO: can the metatype be invalid for dynamic metaobjects?
+ if (const auto mt = metaType(); mt.isValid())
+ return;
return rawTypeNameFromTypeInfo(mobj, data.type());