Commit 76524263 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Fix composite hack in the ObjectNodeInstance



There was no check for the else branch that the type pointer is null.

Change-Id: I0c40eb86f324033dc7878465bd5f603d9b96df06
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent ef584f17
......@@ -1050,20 +1050,19 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN
QObject *object = 0;
QQmlType *type = getQmlType(typeName, majorNumber, minorNumber);
if (type
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
&& !type->isComposite()
if (type) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) // TODO remove hack later if we only support >= 5.2
if ( type->isComposite()) {
object = createComponent(type->sourceUrl(), context);
} else
#endif
) {
if (type->typeName() == "QQmlComponent") {
object = new QQmlComponent(context->engine(), 0);
} else {
object = type->create();
{
if (type->typeName() == "QQmlComponent") {
object = new QQmlComponent(context->engine(), 0);
} else {
object = type->create();
}
}
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
} else if (type->isComposite()) {
object = createComponent(type->sourceUrl(), context);
#endif
} else {
qWarning() << "QuickDesigner: Cannot create an object of type"
<< QString("%1 %2,%3").arg(typeName).arg(majorNumber).arg(minorNumber)
......
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