forked from qt-creator/qt-creator
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: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user