aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-09-30 10:50:11 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-02 15:32:58 +0200
commit85dd91f27b16fabe04575bd3b01bccc44b43d43f (patch)
treee133900cf84a4f4c03d027c800edd18341b18e22 /tools/qmllint
parent5296c163acb520706177807c2a12c30177046fab (diff)
qmllint: Remove ScopeTree::isVisualRootScope()
This is not a property of the ScopeTree itself, but rather a property of how qmllint sets up its scopes. Change-Id: Ifb7c0f1f841046a6ae68e246fbd706f67bedb2af Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint')
-rw-r--r--tools/qmllint/findwarnings.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/qmllint/findwarnings.cpp b/tools/qmllint/findwarnings.cpp
index 3d59259ea3..9fe3bf99bd 100644
--- a/tools/qmllint/findwarnings.cpp
+++ b/tools/qmllint/findwarnings.cpp
@@ -267,8 +267,14 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiScriptBinding *uisb)
auto expstat = cast<ExpressionStatement *>(uisb->statement);
auto identexp = cast<IdentifierExpression *>(expstat->expression);
m_qmlid2scope.insert(identexp->name.toString(), m_currentScope);
- if (m_currentScope->isVisualRootScope())
- m_rootId = identexp->name.toString();
+
+ // Figure out whether the current scope is the root scope.
+ if (auto parentScope = m_currentScope->parentScope()) {
+ if (auto grandParentScope = parentScope->parentScope()) {
+ if (!grandParentScope->parentScope())
+ m_rootId = identexp->name.toString();
+ }
+ }
} else {
const QString signal = signalName(name);
if (signal.isEmpty())