From 096c825084f52b2c292ada10fec8269c027e029c Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 19 Sep 2023 11:14:31 +0200 Subject: [PATCH] QmlJSCheck: Do not warn about visual properties in Connections Change-Id: I1b8d9374021d337d87025290fd025dd600fc3967 Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Reviewed-by: Tim Jenssen --- src/libs/qmljs/qmljscheck.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 9aaf5c02a19..feab41f24bf 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -1442,7 +1442,11 @@ bool Check::visit(BinaryExpression *ast) SourceLocation expressionSourceLocation = locationFromRange(ast->firstSourceLocation(), ast->lastSourceLocation()); - if (expressionAffectsVisualAspects(ast)) + + const bool isDirectInConnectionsScope = (!m_typeStack.isEmpty() + && m_typeStack.last() == "Connections"); + + if (expressionAffectsVisualAspects(ast) && !isDirectInConnectionsScope) addMessage(WarnImperativeCodeNotEditableInVisualDesigner, expressionSourceLocation); // check ==, !=