diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2021-05-11 17:36:08 +0200 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2021-05-14 16:39:40 +0200 |
commit | 04c2546b82d0609fcaab2e792e2b1e0794dca9eb (patch) | |
tree | 807df2b256daab607af986e55c4731dbd5caf3bd /tools | |
parent | f3ed98bf09885795de160468fd615c9e07d5ed5d (diff) |
qmllint: Add inline component support
Adds support for inline components for qmllint with a few things not working yet:
- Two inline components referencing each other
- Using inline components before they are declared
These two issues require a larger overhaul of qmllint as a whole and will be addressed in a different change.
Change-Id: I2834702c21a8eb728db4709d6f475c33796b3e4d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmllint/findwarnings.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/qmllint/findwarnings.cpp b/tools/qmllint/findwarnings.cpp index 4041cac8df..ce78d8285b 100644 --- a/tools/qmllint/findwarnings.cpp +++ b/tools/qmllint/findwarnings.cpp @@ -144,7 +144,8 @@ void FindWarningVisitor::flushPendingSignalParameters() void FindWarningVisitor::checkDefaultProperty(const QQmlJSScope::ConstPtr &scope) { - if (scope == m_exportedRootScope || scope->isArrayScope()) // inapplicable + if (scope == m_exportedRootScope || scope->isArrayScope() + || scope->isInlineComponent()) // inapplicable return; // These warnings do not apply for custom parsers and their children and need to be handled on a @@ -670,8 +671,9 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiPublicMember *uipb) if (uipb->type == QQmlJS::AST::UiPublicMember::Property && uipb->memberType != nullptr && !uipb->memberType->name.isEmpty() && uipb->memberType->name != QLatin1String("alias")) { const auto name = uipb->memberType->name.toString(); - if (m_importTypeLocationMap.contains(name)) { - m_usedTypes.insert(name); + if (m_rootScopeImports.contains(name) && !m_rootScopeImports[name].isNull()) { + if (m_importTypeLocationMap.contains(name)) + m_usedTypes.insert(name); } else { m_logger.log(name + QStringLiteral(" was not found. Did you add all import paths?"), Log_Import); |