forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Thomas Hartmann
parent
1562ec7bce
commit
2cab55ea1a
@@ -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)
|
||||
|
Reference in New Issue
Block a user