Commit c7a6221e authored by Thomas Hartmann's avatar Thomas Hartmann Committed by Tim Jenssen
Browse files

QmlDesigner: Evaluate properties for the root item in dummy context

We evaluate properties for the root item in dummy context if
they contain "parent.".

Defining a parent in the dummy context was not working for QML 2,
because there seems to be a shortcut bypassing the metasystem for parent.

Task-number: QTCREATORBUG-15530
Change-Id: I710f1ef36b8c97cc481b9909a775f06d9e03f666
Reviewed-by: default avatarTim Jenssen <>
parent 72af6b78
......@@ -644,6 +644,16 @@ void QuickItemNodeInstance::setPropertyBinding(const PropertyName &name, const Q
/* Evaluate properties of the root item in the context of the dummy context if they contain parent.
* This is done manually because we cannot "overwrite" the parent property
if (isRootNodeInstance() && expression.contains(QLatin1String("parent."))) {
QQmlExpression qmlContextExpression(context(), nodeInstanceServer()->dummyContextObject(), expression);
QVariant value = qmlContextExpression.evaluate();
setPropertyVariant(name, value);
if (isInLayoutable())
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