summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-02-05 14:25:07 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2021-02-15 08:08:52 +0100
commita267a177bd85c0cd5123894b4edcc4e9cc759cba (patch)
treeffe882b2231ceb35f6dcdcabd49016240e26caaf
parent4c48fd73abfce63f2db7d962a94c3d9507b3bf19 (diff)
QQmlPropertyBinding: Create more verbose binding loop warning
Change-Id: I6f83fc61c72993c04c99ff16c31c10b20ada5db8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--src/qml/qml/qqmlpropertybinding.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlpropertybinding.cpp b/src/qml/qml/qqmlpropertybinding.cpp
index 313cd7f395..c0b2d75c6e 100644
--- a/src/qml/qml/qqmlpropertybinding.cpp
+++ b/src/qml/qml/qqmlpropertybinding.cpp
@@ -86,7 +86,12 @@ void QQmlPropertyBinding::expressionChanged()
err.setUrl(QUrl{location.sourceFile});
err.setLine(location.line);
err.setColumn(location.column);
- err.setDescription(QString::fromLatin1("Binding loop detected"));
+ const auto ctxt = context();
+ QQmlEngine *engine = ctxt ? ctxt->engine() : nullptr;
+ if (engine)
+ err.setDescription(createBindingLoopErrorDescription(QQmlEnginePrivate::get(engine)));
+ else
+ err.setDescription(QString::fromLatin1("Binding loop detected"));
err.setObject(target());
qmlWarning(this->scopeObject(), err);
return;