QmlJS:: Allow qsTr() for .ui.qml files

Change-Id: I8ccae13653bbb010853d99be9136bf364b823c3d
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Thomas Hartmann
2014-10-14 15:30:15 +02:00
parent 033b711dc7
commit 11b30a22ed

View File

@@ -1541,7 +1541,10 @@ bool Check::visit(CallExpression *ast)
SourceLocation location;
const QString name = functionName(ast->base, &location);
addMessage(ErrFunctionsNotSupportedInQmlUi, location);
//We have to allow the qsTr function for translation.
if (name != QLatin1String("qsTr"))
addMessage(ErrFunctionsNotSupportedInQmlUi, location);
if (!name.isEmpty() && name.at(0).isUpper()
&& name != QLatin1String("String")
&& name != QLatin1String("Boolean")