aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmldom
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@qt.io>2021-06-27 00:56:14 +0200
committerFawzi Mohamed <fawzi.mohamed@qt.io>2021-08-27 08:48:56 +0200
commit0b0afa576aaba4fab7749a62830daa353b628e08 (patch)
tree2f59157249ab82401d47929b817750bc897b991f /tools/qmldom
parent42aa1d510214bb51f35c9ab0c798e39558d341cb (diff)
qmldom: support qmltypes
read qmltypes files using the QmlCompiler provided reader Change-Id: Ifb091a1d645e697cd3b648da96c69868f240d037 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tools/qmldom')
-rw-r--r--tools/qmldom/qmldomtool.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/qmldom/qmldomtool.cpp b/tools/qmldom/qmldomtool.cpp
index 1ab9dedc6a..8efa652082 100644
--- a/tools/qmldom/qmldomtool.cpp
+++ b/tools/qmldom/qmldomtool.cpp
@@ -111,6 +111,13 @@ int main(int argc, char *argv[])
QLatin1String("pathToDump"));
parser.addOption(pathToDumpOption);
+ QCommandLineOption dependenciesOption(
+ QStringList() << "D"
+ << "dependencies",
+ QLatin1String("Dependencies to load: none, required, reachable"),
+ QLatin1String("dependenciesToLoad"), QLatin1String("required"));
+ parser.addOption(dependenciesOption);
+
QCommandLineOption reformatDirOption(
QStringList() << "reformat-dir",
QLatin1String(
@@ -146,6 +153,24 @@ int main(int argc, char *argv[])
}
Dependencies dep = Dependencies::None;
+ for (QString depName : parser.values(dependenciesOption)) {
+ QMetaEnum metaEnum = QMetaEnum::fromType<Dependencies>();
+ bool found = false;
+ for (int i = 0; i < metaEnum.keyCount(); ++i) {
+ if (QLatin1String(metaEnum.key(i)).compare(depName, Qt::CaseInsensitive) == 0) {
+ found = true;
+ dep = Dependencies(metaEnum.value(i));
+ }
+ }
+ if (!found) {
+ QStringList values;
+ for (int i = 0; i < metaEnum.keyCount(); ++i)
+ values.append(QString::fromUtf8(metaEnum.key(i)).toLower());
+ qDebug().noquote() << "Invalid dependencies argument, expected one of "
+ << values.join(QLatin1Char(','));
+ return 1;
+ }
+ }
int nBackups = 2;
if (parser.isSet(nBackupsOption)) {