diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 262afb2677..10fc5701e5 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -1735,6 +1735,8 @@ static QtPrivate::QMetaTypeInterface *interfaceForType(int typeId) QT_FOR_EACH_STATIC_CORE_POINTER(QT_METATYPE_CONVERT_ID_TO_TYPE) QT_FOR_EACH_STATIC_CORE_TEMPLATE(QT_METATYPE_CONVERT_ID_TO_TYPE) default: + if (typeId != QMetaType::UnknownType) + qWarning("Trying to construct an instance of an invalid type, type id: %i", typeId); return nullptr; } } diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 75bdd99dfd..97c1e584ac 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1752,9 +1752,6 @@ Q_CORE_EXPORT void QVariantPrivate::registerHandler(const int /* Modules::Names void QVariant::create(int type, const void *copy) { d = Private(QMetaType(type)); - if (Q_UNLIKELY(type && !d.type().isValid())) { - qWarning("Trying to construct an instance of an invalid type, type id: %i", type); - } customConstruct(&d, copy); }