summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljscheck.cpp
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2016-10-28 16:10:18 +0200
committerThomas Hartmann <Thomas.Hartmann@theqtcompany.com>2016-10-28 14:27:58 +0000
commit2cab55ea1ae664e0677c6508efad4a52c181c1f5 (patch)
tree4aad4cb7f3b6b66e568338a78ecfc42c9a8eaadb /src/libs/qmljs/qmljscheck.cpp
parent1562ec7bceb438ea8b293b3a2ccf01c730b31a57 (diff)
downloadqt-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.cpp7
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)