aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmltc/main.cpp
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2022-01-18 13:08:09 +0100
committerMaximilian Goldstein <max.goldstein@qt.io>2022-02-03 11:17:34 +0100
commitdc9de38abe797e835480171a047bf96e98c84e1f (patch)
tree1ce1b77174fdc38c45a23555399a665591da2b80 /tools/qmltc/main.cpp
parenta0f5baad2a645bfaa65773451e9d76944ae9a951 (diff)
qmllint: Warn about missing singleton pragmas/qmldir entries
This change adds a warning if we encounter a component marked as a singleton in a qmldir file which does not contain a pragma Singleton entry and vice versa. Note that the warning only gets triggered if the singleton is actually used. Fixes: QTBUG-98558 Change-Id: Id7c63f48ba49759c15dffcaee0270c7caab2eb7d Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tools/qmltc/main.cpp')
-rw-r--r--tools/qmltc/main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/qmltc/main.cpp b/tools/qmltc/main.cpp
index 152a61fb24..c2002235cf 100644
--- a/tools/qmltc/main.cpp
+++ b/tools/qmltc/main.cpp
@@ -198,6 +198,17 @@ int main(int argc, char **argv)
CodeGenerator generator(url, &logger, &document, &typeResolver);
generator.generate(options);
+# if 0 // TODO: Currently disabled due to QTBUG-100103, remove this #if guard once the issue has
+ // been addressed
+ QList<QQmlJS::DiagnosticMessage> warnings = importer.takeGlobalWarnings();
+
+ if (!warnings.isEmpty()) {
+ logger.logWarning(QStringLiteral("Type warnings occurred while compiling file:"),
+ Log_Import);
+ logger.processMessages(warnings, QtWarningMsg, Log_Import);
+ }
+# endif
+
if (logger.hasWarnings() || logger.hasErrors())
return EXIT_FAILURE;