forked from qt-creator/qt-creator
Fix binding assignment failing sometimes
Change-Id: Ic94cc911411d3162cd840feba86a445a4bc76c8e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -507,6 +507,17 @@ void ObjectNodeInstance::setPropertyBinding(const PropertyName &name, const QStr
|
|||||||
|
|
||||||
bool qmlExpressionHasError = false;
|
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()) {
|
if (!isPropertyChange()) {
|
||||||
QQmlExpression qmlExpression(context(), object(), expression);
|
QQmlExpression qmlExpression(context(), object(), expression);
|
||||||
qmlExpression.evaluate();
|
qmlExpression.evaluate();
|
||||||
|
Reference in New Issue
Block a user