forked from qt-creator/qt-creator
QmlDesigner: Fix crash on puppet
Change-Id: I233d3dab5a509bfd7c9a30c7dcc15dcf8751f456 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
72302cac49
commit
003282c6f5
@@ -779,7 +779,9 @@ QObject *ObjectNodeInstance::createComponent(const QUrl &componentUrl, QQmlConte
|
|||||||
return QmlPrivateGate::createComponent(componentUrl, context);
|
return QmlPrivateGate::createComponent(componentUrl, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource, const QByteArray &importCode, QQmlContext *context)
|
QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource,
|
||||||
|
const QByteArray &importCode,
|
||||||
|
QQmlContext *context)
|
||||||
{
|
{
|
||||||
QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete;
|
QmlPrivateGate::ComponentCompleteDisabler disableComponentComplete;
|
||||||
Q_UNUSED(disableComponentComplete)
|
Q_UNUSED(disableComponentComplete)
|
||||||
@@ -790,9 +792,11 @@ QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource,
|
|||||||
data.prepend(importCode);
|
data.prepend(importCode);
|
||||||
component.setData(data, context->baseUrl().resolved(QUrl("createCustomParserObject.qml")));
|
component.setData(data, context->baseUrl().resolved(QUrl("createCustomParserObject.qml")));
|
||||||
QObject *object = component.beginCreate(context);
|
QObject *object = component.beginCreate(context);
|
||||||
|
if (object) {
|
||||||
QmlPrivateGate::tweakObjects(object);
|
QmlPrivateGate::tweakObjects(object);
|
||||||
component.completeCreate();
|
component.completeCreate();
|
||||||
QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership);
|
QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership);
|
||||||
|
}
|
||||||
|
|
||||||
if (component.isError()) {
|
if (component.isError()) {
|
||||||
qWarning() << "Error in:" << Q_FUNC_INFO << component.url().toString();
|
qWarning() << "Error in:" << Q_FUNC_INFO << component.url().toString();
|
||||||
|
Reference in New Issue
Block a user