aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsloggingutils.h
diff options
context:
space:
mode:
authorSami Shalayel <sami.shalayel@qt.io>2024-10-15 11:09:20 +0200
committerSami Shalayel <sami.shalayel@qt.io>2025-01-02 17:48:52 +0100
commit8b61addfa42525c1bd5f27febbe62dcbdb645fc9 (patch)
tree3b438428faea9cf9e09c01911c5b32ca5ab2f5c4 /src/qmlcompiler/qqmljsloggingutils.h
parent86328115468bf474ba565b9f97cdbb551bb467e7 (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.h1
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;