diff --git a/src/tools/qml2puppet/qml2puppet/instances/objectnodeinstance.cpp b/src/tools/qml2puppet/qml2puppet/instances/objectnodeinstance.cpp index fc171c87723..8a982f5cdd5 100644 --- a/src/tools/qml2puppet/qml2puppet/instances/objectnodeinstance.cpp +++ b/src/tools/qml2puppet/qml2puppet/instances/objectnodeinstance.cpp @@ -507,6 +507,17 @@ void ObjectNodeInstance::setPropertyBinding(const PropertyName &name, const QStr bool qmlExpressionHasError = false; + QStringList idlist; + for (const auto &instance : nodeInstanceServer()->nodeInstances()) + idlist.append(instance.id()); + + // Always set ids using the root context, since they are defined there anyway + if (idlist.contains(expression)) { + QmlPrivateGate::setPropertyBinding(object(), + context()->engine()->rootContext(), name, expression); + return; + } + if (!isPropertyChange()) { QQmlExpression qmlExpression(context(), object(), expression); qmlExpression.evaluate();