diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2023-09-19 11:14:31 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2023-09-19 12:59:16 +0000 |
commit | 8d49c7f996ef2895ecc28a3fcd46eee6a68c7a96 (patch) | |
tree | 0d276d09c043bb881c26d2b50cc056c52dc6fc8a | |
parent | 615bbe1844ec577cb26121d4a777457fe5c4236f (diff) |
QmlJSCheck: Do not warn about visual properties in Connections
Change-Id: I1b8d9374021d337d87025290fd025dd600fc3967
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
(cherry picked from commit c16ace71549306bb8c01e7f24e16328069c404c7)
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r-- | src/libs/qmljs/qmljscheck.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 9aaf5c02a1..feab41f24b 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 ==, != |