aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmltc
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2021-12-15 11:38:30 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-12-17 22:48:16 +0000
commit0de3f6667f67207c3aea50860aed0be035d8889c (patch)
treefa8e82b5b41b09c9493d97150f66eabfc7f1141b /tools/qmltc
parente5d1f78b6f0f0ae5d36ff367c1771af5a5c83d74 (diff)
qmltc: Explicitly reject inline components
Because they seem to be hard and there's little reason to invest in their support immediately Task-number: QTBUG-84368 Change-Id: If056aa401d8f54d067eb583669074cb3f6bfd304 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 8fac197ba20cca5a85f8caedf4cb3e4f4c7ac553) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tools/qmltc')
-rw-r--r--tools/qmltc/prototype/visitor.cpp11
-rw-r--r--tools/qmltc/prototype/visitor.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/tools/qmltc/prototype/visitor.cpp b/tools/qmltc/prototype/visitor.cpp
index 47d16cf505..07e5e41214 100644
--- a/tools/qmltc/prototype/visitor.cpp
+++ b/tools/qmltc/prototype/visitor.cpp
@@ -59,4 +59,15 @@ bool Visitor::visit(QQmlJS::AST::UiImport *import)
}
return true;
}
+
+bool Visitor::visit(QQmlJS::AST::UiInlineComponent *component)
+{
+ if (!QQmlJSImportVisitor::visit(component))
+ return false;
+ m_logger->logCritical(u"Inline components are not supported"_qs, Log_Compiler,
+ component->firstSourceLocation());
+ // despite the failure, return true here so that we do not assert in
+ // QQmlJSImportVisitor::endVisit(UiInlineComponent)
+ return true;
+}
}
diff --git a/tools/qmltc/prototype/visitor.h b/tools/qmltc/prototype/visitor.h
index 4fc925d465..2df72b25ae 100644
--- a/tools/qmltc/prototype/visitor.h
+++ b/tools/qmltc/prototype/visitor.h
@@ -52,6 +52,7 @@ public:
const QStringList &qmltypesFiles = QStringList());
bool visit(QQmlJS::AST::UiImport *import) override;
+ bool visit(QQmlJS::AST::UiInlineComponent *) override;
QString getImplicitImportDirectory() const { return m_implicitImportDirectory; }
QStringList getImportedDirectories() const { return m_importedDirectories; }