QmlDesigner: Allow qsTranslate in .ui.qml files

Also adding the NoOp functions. They can be used in models.

Task-number: QTCREATORBUG-17714
Change-Id: Ide9745613850580f0098d2fa7f8889809d18bd45
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2017-02-10 14:14:32 +01:00
parent 969fedc2d2
commit fb14b4a6c8

View File

@@ -1625,11 +1625,14 @@ bool Check::visit(CallExpression *ast)
const QString namespaceName = functionNamespace(ast->base);
// We have to allow the qsTr function for translation.
// We have to allow the translation functions
const QStringList translationFunctions = { "qsTr", "qsTrId", "qsTranslate",
"qsTrNoOp", "qsTrIdNoOp", "qsTranslateNoOp" };
const bool isTranslationFunction = translationFunctions.contains(name);
const bool isTranslationFunction = (name == QLatin1String("qsTr") || name == QLatin1String("qsTrId"));
// We allow the Math. functions
const bool isMathFunction = namespaceName == "Math";
// allow adding connections with the help of the qt quick designer ui
bool isDirectInConnectionsScope =