Commit 4eac04fb authored by Marco Bubke's avatar Marco Bubke Committed by Kai Koehne
Browse files

Check if the qml type exists to create a object

This will failing late but should be handled better.

Reviewed-by: kkoehne
parent cdb69f7f
......@@ -184,7 +184,15 @@ QObject *NodeMetaInfo::createInstance(QDeclarativeContext *context) const
} else {
// primitive
object = QDeclarativeMetaType::qmlType(typeName().toAscii(), majorVersion(), minorVersion())->create();
QDeclarativeType *type = QDeclarativeMetaType::qmlType(typeName().toAscii(), majorVersion(), minorVersion());
if (type) {
object = type->create();
} else {
qWarning() << "QuickDesigner: Cannot create an object of type"
<< QString("%1 %2,%3").arg(typeName(), majorVersion(), minorVersion())
<< "- type isn't known to declarative meta type system";
if (object && context)
QDeclarativeEngine::setContextForObject(object, context);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment