QmlDesigner: allow adding connections in ui.qml files

Change-Id: Ia4d9f01f41ca2bca1eca0df3cf121ae2800e31d4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
Tim Jenssen
2016-05-26 15:12:20 +02:00
parent b18e4feac7
commit 3c2dc15f6d

View File

@@ -1548,8 +1548,11 @@ bool Check::visit(CallExpression *ast)
SourceLocation location;
const QString name = functionName(ast->base, &location);
//We have to allow the qsTr function for translation.
if (name != QLatin1String("qsTr") && name != QLatin1String("qsTrId"))
// We have to allow the qsTr function for translation.
bool isTranslationFunction = (name == QLatin1String("qsTr") || name == QLatin1String("qsTrId"));
// allow adding connections with the help of the qt quick designer ui
bool isDirectInConnectionsScope = m_typeStack.last() == QLatin1String("Connections");
if (!isTranslationFunction && !isDirectInConnectionsScope)
addMessage(ErrFunctionsNotSupportedInQmlUi, location);
if (!name.isEmpty() && name.at(0).isUpper()