Commit d8c51d9a authored by Tobias Hunger's avatar Tobias Hunger

QmlPuppet: Fix build failure for Qt with versions >=5.0 and <=5.2

QQmlType::isComposite and QQmlType::sourceUrl are both unavailable
when used in objectnodeinstance.cpp

Change-Id: I21f66b00348c0535b4779206bd63e363f4b2c225
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 62f056a2
......@@ -1050,14 +1050,20 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN
QObject *object = 0;
QQmlType *type = getQmlType(typeName, majorNumber, minorNumber);
if (type && !type->isComposite()) {
if (type
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
&& !type->isComposite()
#endif
) {
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