diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 80c511107a..48f27f9bc7 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -6,6 +6,7 @@ #include "qmetatype.h" #include "qobject.h" #include "qmetaobject_p.h" +#include "qmetatype_p.h" #include #include @@ -405,7 +406,7 @@ QMetaType QMetaObject::metaType() const data:QMetaType(prop0), ..., QMetaType(propPropCount-1), QMetaType(class),... */ auto iface = this->d.metaTypes[d->propertyCount]; - if (iface == QtPrivate::qMetaTypeInterfaceForType()) + if (iface && QtMetaTypePrivate::isInterfaceFor(iface)) return QMetaType(); // return invalid meta-type for namespaces if (iface) return QMetaType(iface);