Don't crash when the containment or toolbox doesn't load
Check if the containment could be loaded (this includes the toolbox), if not, don't poke into its rootObject.
This commit is contained in:
parent
788870fffc
commit
fe8be600c6
@ -168,13 +168,14 @@ void AppletInterface::init()
|
||||
}
|
||||
|
||||
//set parent, both as object hyerarchy and visually
|
||||
m_qmlObject->rootObject()->setProperty("parent", QVariant::fromValue(this));
|
||||
|
||||
//set anchors
|
||||
QQmlExpression expr(m_qmlObject->engine()->rootContext(), m_qmlObject->rootObject(), "parent");
|
||||
QQmlProperty prop(m_qmlObject->rootObject(), "anchors.fill");
|
||||
prop.write(expr.evaluate());
|
||||
if (m_qmlObject->rootObject()) {
|
||||
m_qmlObject->rootObject()->setProperty("parent", QVariant::fromValue(this));
|
||||
|
||||
//set anchors
|
||||
QQmlExpression expr(m_qmlObject->engine()->rootContext(), m_qmlObject->rootObject(), "parent");
|
||||
QQmlProperty prop(m_qmlObject->rootObject(), "anchors.fill");
|
||||
prop.write(expr.evaluate());
|
||||
}
|
||||
geometryChanged(QRectF(), QRectF(x(), y(), width(), height()));
|
||||
emit busyChanged();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user