diff options
Diffstat (limited to 'tools/qmllint')
-rw-r--r-- | tools/qmllint/findwarnings.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/qmllint/findwarnings.cpp b/tools/qmllint/findwarnings.cpp index fb69756415..09ef63d4bd 100644 --- a/tools/qmllint/findwarnings.cpp +++ b/tools/qmllint/findwarnings.cpp @@ -902,7 +902,19 @@ void FindWarningVisitor::endVisit(QQmlJS::AST::UiObjectDefinition *) { auto childScope = m_currentScope; leaveEnvironment(); - childScope->updateParentProperty(m_currentScope); + + if (m_currentScope->baseTypeName() == QStringLiteral("Component") + || m_currentScope->baseTypeName() == QStringLiteral("program")) { + return; + } + + const auto properties = childScope->properties(); + const auto it = properties.find(QStringLiteral("parent")); + if (it != properties.end()) { + auto property = *it; + property.setType(m_currentScope); + childScope->addProperty(property); + } } bool FindWarningVisitor::visit(QQmlJS::AST::FieldMemberExpression *) |