Commit 3c2dc15f authored by Tim Jenssen's avatar Tim Jenssen

QmlDesigner: allow adding connections in ui.qml files

Change-Id: Ia4d9f01f41ca2bca1eca0df3cf121ae2800e31d4
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@theqtcompany.com>
parent b18e4fea
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment