diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2016-10-28 16:10:18 +0200 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@theqtcompany.com> | 2016-10-28 14:27:58 +0000 |
commit | 2cab55ea1ae664e0677c6508efad4a52c181c1f5 (patch) | |
tree | 4aad4cb7f3b6b66e568338a78ecfc42c9a8eaadb /src/libs/qmljs/qmljscheck.cpp | |
parent | 1562ec7bceb438ea8b293b3a2ccf01c730b31a57 (diff) | |
download | qt-creator-2cab55ea1ae664e0677c6508efad4a52c181c1f5.tar.gz |
QmlDesigner: Allow JavaScrip blocks in Connections in .ui.qml
Inside a Connections item JavaScript blocks should be allowed.
Change-Id: Ia6a08fc575a72980bd53a32249bf302b7a426266
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Diffstat (limited to 'src/libs/qmljs/qmljscheck.cpp')
-rw-r--r-- | src/libs/qmljs/qmljscheck.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index c9c136d178..936beec915 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -1252,7 +1252,12 @@ bool Check::visit(BinaryExpression *ast) bool Check::visit(Block *ast) { - addMessage(ErrBlocksNotSupportedInQmlUi, locationFromRange(ast->firstSourceLocation(), ast->lastSourceLocation())); + + bool isDirectInConnectionsScope = + (!m_typeStack.isEmpty() && m_typeStack.last() == QLatin1String("Connections")); + + if (!isDirectInConnectionsScope) + addMessage(ErrBlocksNotSupportedInQmlUi, locationFromRange(ast->firstSourceLocation(), ast->lastSourceLocation())); if (Node *p = parent()) { if (!cast<UiScriptBinding *>(p) |