diff options
| author | Sami Shalayel <sami.shalayel@qt.io> | 2024-10-15 11:09:20 +0200 |
|---|---|---|
| committer | Sami Shalayel <sami.shalayel@qt.io> | 2025-01-02 17:48:52 +0100 |
| commit | 8b61addfa42525c1bd5f27febbe62dcbdb645fc9 (patch) | |
| tree | 3b438428faea9cf9e09c01911c5b32ca5ab2f5c4 /src/qmlcompiler/qqmljsloggingutils.h | |
| parent | 86328115468bf474ba565b9f97cdbb551bb467e7 (diff) | |
qmllint: warn about mixing translation functions
It seems that mixing different translation functions (id-based with
non-id based translations) is not supported in the same qml file.
Therefore, emit a warning when mixing up id and non-id translation
methods.
Currently, it is not possible to have warnings for mixing usages of
QT_TRANSLATE_NOOP(), QT_QSTR_NOOP(), QT_QSTRID_NOOP() but that
should not be too important for the actual feature, as calls to
QT_QSTR_NOOP and QT_TRANSLATE_NOOP only make sense when there is
a qsTr or qsTranslate around.
Add a QEXPECT_FAIL test for that.
Task-number: QTBUG-129308
Change-Id: I8b19ca997cd6b4b8619c53c079dd72b9510fb904
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsloggingutils.h')
| -rw-r--r-- | src/qmlcompiler/qqmljsloggingutils.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsloggingutils.h b/src/qmlcompiler/qqmljsloggingutils.h index 5d48cd379b..ab1631b7ce 100644 --- a/src/qmlcompiler/qqmljsloggingutils.h +++ b/src/qmlcompiler/qqmljsloggingutils.h @@ -74,6 +74,7 @@ extern const Q_QMLCOMPILER_EXPORT QQmlSA::LoggerWarningId qmlInvalidLintDirectiv extern const Q_QMLCOMPILER_EXPORT QQmlSA::LoggerWarningId qmlUseProperFunction; extern const Q_QMLCOMPILER_EXPORT QQmlSA::LoggerWarningId qmlAccessSingleton; extern const Q_QMLCOMPILER_EXPORT QQmlSA::LoggerWarningId qmlTopLevelComponent; +extern const Q_QMLCOMPILER_EXPORT QQmlSA::LoggerWarningId qmlTranslationFunctionMismatch; extern const Q_QMLCOMPILER_EXPORT QQmlSA::LoggerWarningId qmlUncreatableType; extern const Q_QMLCOMPILER_EXPORT QQmlSA::LoggerWarningId qmlMissingEnumEntry; |
