diff options
Diffstat (limited to 'src/qmlcompiler')
| -rw-r--r-- | src/qmlcompiler/qqmljsimportvisitor.cpp | 17 | ||||
| -rw-r--r-- | src/qmlcompiler/qqmljsimportvisitor_p.h | 4 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp index 6ac9a73a61..7af1cff209 100644 --- a/src/qmlcompiler/qqmljsimportvisitor.cpp +++ b/src/qmlcompiler/qqmljsimportvisitor.cpp @@ -603,7 +603,7 @@ void QQmlJSImportVisitor::processDefaultProperties() QQmlJSScope::ConstPtr parentScope = it.key(); // We can't expect custom parser default properties to be sensible, discard them for now. - if (parentScope->isInCustomParserParent()) + if (checkCustomParser(parentScope)) continue; /* consider: @@ -1071,7 +1071,7 @@ void QQmlJSImportVisitor::processPropertyBindings() // These warnings do not apply for custom parsers and their children and need to be // handled on a case by case basis - if (scope->isInCustomParserParent()) + if (checkCustomParser(scope)) continue; // TODO: Can this be in a better suited category? @@ -1273,7 +1273,7 @@ void QQmlJSImportVisitor::addDefaultProperties() m_pendingDefaultProperties[m_currentScope->parentScope()] << m_currentScope; - if (parentScope->isInCustomParserParent()) + if (checkCustomParser(parentScope)) return; /* consider: @@ -1370,7 +1370,7 @@ void QQmlJSImportVisitor::checkGroupedAndAttachedScopes(QQmlJSScope::ConstPtr sc { // These warnings do not apply for custom parsers and their children and need to be handled on a // case by case basis - if (scope->isInCustomParserParent()) + if (checkCustomParser(scope)) return; auto children = scope->childScopes(); @@ -1396,6 +1396,11 @@ void QQmlJSImportVisitor::checkGroupedAndAttachedScopes(QQmlJSScope::ConstPtr sc } } +bool QQmlJSImportVisitor::checkCustomParser(const QQmlJSScope::ConstPtr &scope) +{ + return scope->isInCustomParserParent(); +} + void QQmlJSImportVisitor::flushPendingSignalParameters() { const QQmlJSMetaSignalHandler handler = m_signalHandlers[m_pendingSignalHandler]; @@ -2390,7 +2395,7 @@ void QQmlJSImportVisitor::endVisit(UiArrayBinding *arrayBinding) const auto propertyName = getScopeName(m_currentScope, QQmlSA::ScopeType::QMLScope); leaveEnvironment(); - if (m_currentScope->isInCustomParserParent()) { + if (checkCustomParser(m_currentScope)) { // These warnings do not apply for custom parsers and their children and need to be handled // on a case by case basis return; @@ -2951,7 +2956,7 @@ void QQmlJSImportVisitor::endVisit(QQmlJS::AST::UiObjectBinding *uiob) } } - if (m_currentScope->isInCustomParserParent()) { + if (checkCustomParser(m_currentScope)) { // These warnings do not apply for custom parsers and their children and need to be handled // on a case by case basis } else { diff --git a/src/qmlcompiler/qqmljsimportvisitor_p.h b/src/qmlcompiler/qqmljsimportvisitor_p.h index abaca7a691..c56f6a9f99 100644 --- a/src/qmlcompiler/qqmljsimportvisitor_p.h +++ b/src/qmlcompiler/qqmljsimportvisitor_p.h @@ -159,6 +159,8 @@ protected: void throwRecursionDepthError() override; + virtual bool checkCustomParser(const QQmlJSScope::ConstPtr &scope); + QString m_implicitImportDirectory; QStringList m_qmldirFiles; QQmlJSScope::Ptr m_currentScope; @@ -266,7 +268,7 @@ protected: template<typename ErrorHandler> bool checkTypeResolved(const QQmlJSScope::ConstPtr &type, ErrorHandler handle) { - if (type->isFullyResolved() || type->isInCustomParserParent()) + if (type->isFullyResolved() || checkCustomParser(type)) return true; // Note: ignore duplicates, but only after we are certain that the type |
