From a267a177bd85c0cd5123894b4edcc4e9cc759cba Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Fri, 5 Feb 2021 14:25:07 +0100 Subject: QQmlPropertyBinding: Create more verbose binding loop warning Change-Id: I6f83fc61c72993c04c99ff16c31c10b20ada5db8 Reviewed-by: Ulf Hermann --- src/qml/qml/qqmlpropertybinding.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3