aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmltc/main.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <[email protected]>2025-06-03 13:43:35 +0300
committerTarja Sundqvist <[email protected]>2025-06-03 13:43:35 +0300
commit0f0972d542d9869c2dcfaf9c963d42ff32766460 (patch)
treef283360ffbf0453e04a321e01f0c3df1c07df3e3 /tools/qmltc/main.cpp
parent07e23b0f4983631524716f034c0268fd11d037f9 (diff)
parentff0a47c8f267e905113b82c53af2742027f0eca6 (diff)
Merge tag 'v6.5.6-lts-lgpl' into 6.56.5
Qt 6.5.6-lts-lgpl release
Diffstat (limited to 'tools/qmltc/main.cpp')
-rw-r--r--tools/qmltc/main.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/qmltc/main.cpp b/tools/qmltc/main.cpp
index 09ae1fff3b..7138343038 100644
--- a/tools/qmltc/main.cpp
+++ b/tools/qmltc/main.cpp
@@ -100,6 +100,13 @@ int main(int argc, char **argv)
QCoreApplication::translate("main", "namespace")
};
parser.addOption(namespaceOption);
+ QCommandLineOption moduleOption{
+ u"module"_s,
+ QCoreApplication::translate("main",
+ "Name of the QML module that this QML code belongs to."),
+ QCoreApplication::translate("main", "module")
+ };
+ parser.addOption(moduleOption);
parser.process(app);
@@ -249,7 +256,11 @@ int main(int argc, char **argv)
logger.setCode(sourceCode);
setupLogger(logger);
- QmltcVisitor visitor(QQmlJSScope::create(), &importer, &logger,
+ auto currentScope = QQmlJSScope::create();
+ if (parser.isSet(moduleOption))
+ currentScope->setModuleName(parser.value(moduleOption));
+
+ QmltcVisitor visitor(currentScope, &importer, &logger,
QQmlJSImportVisitor::implicitImportDirectory(url, &mapper), qmldirFiles);
visitor.setMode(QmltcVisitor::Compile);
QmltcTypeResolver typeResolver { &importer };