QmlDesigner: Use QQuickView::setContent to set root component

Change-Id: I8d5700c71fd4e46f0463bf02195506251f71a853
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Marco Bubke
2013-09-09 13:24:43 +02:00
parent 3273bac2c2
commit 2507a24ba9

View File

@@ -374,12 +374,10 @@ void NodeInstanceServer::setupImports(const QVector<AddImportContainer> &contain
componentString += QString("Item {}\n"); componentString += QString("Item {}\n");
if (quickView()) { m_importComponent = new QQmlComponent(engine(), quickView());
QQuickViewPrivate::get(quickView())->component = new QQmlComponent(engine(), quickView());
m_importComponent = QQuickViewPrivate::get(quickView())->component; if (quickView())
} else { quickView()->setContent(fileUrl(), m_importComponent, quickView()->rootObject());
m_importComponent = new QQmlComponent(engine(), 0);
}
m_importComponent->setData(componentString.toUtf8(), fileUrl()); m_importComponent->setData(componentString.toUtf8(), fileUrl());
m_importComponentObject = m_importComponent->create(); m_importComponentObject = m_importComponent->create();