Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQmlJSImportVisitor Class Reference

#include <qqmljsimportvisitor_p.h>

Inheritance diagram for QQmlJSImportVisitor:
Collaboration diagram for QQmlJSImportVisitor:

Classes

struct  PendingMethodTypeAnnotations
struct  PendingPropertyObjectBinding
struct  PendingPropertyType
struct  RequiredProperty
struct  ScopeAndNameT
struct  UnfinishedBinding
struct  WithVisibilityScope
 Utility wrapper that adds visibility scope to the data. More...

Public Member Functions

 QQmlJSImportVisitor (const QQmlJSScope::Ptr &target, QQmlJSImporter *importer, QQmlJSLogger *logger, const QString &implicitImportDirectory, const QStringList &qmldirFiles=QStringList())
 QQmlJSImportVisitor (QQmlJSImporter *importer, QQmlJSLogger *logger, const QString &implicitImportDirectory, const QStringList &qmldirFiles=QStringList())
 ~QQmlJSImportVisitor ()
QQmlJSScope::Ptr result () const
const QQmlJSLoggerlogger () const
QQmlJSLoggerlogger ()
QQmlJSImporter::ImportedTypes imports () const
QQmlJSScopesById addressableScopes () const
QHash< QQmlJS::SourceLocation, QQmlJSMetaSignalHandlersignalHandlers () const
QList< QQmlJSScope::ConstPtrqmlTypes () const
QHash< QV4::CompiledData::Location, QQmlJSScope::ConstPtrscopesBylocation () const
QQmlJSImporterimporter ()
const QQmlJSImporterimporter () const
QStringList seenModuleQualifiers () const
void postVisit (Node *) override
bool preVisit (Node *) override
Public Member Functions inherited from QQmlJS::AST::Visitor
 Visitor (quint16 parentRecursionDepth=0)
bool preVisit (Node *) override
void postVisit (Node *) override
Public Member Functions inherited from QQmlJS::AST::BaseVisitor
 BaseVisitor (quint16 parentRecursionDepth=0)
virtual ~BaseVisitor ()
quint16 recursionDepth () const

Static Public Member Functions

static QString implicitImportDirectory (const QString &localFile, QQmlJSResourceFileMapper *mapper)

Protected Types

enum class  BindingExpressionParseResult { Invalid , Script , Literal , Translation }
enum class  BindingForPropertyDefintion { Yes , No }
using RootDocumentNameType = QQmlJSScope::RootDocumentNameType
using InlineComponentNameType = QQmlJSScope::InlineComponentNameType
using InlineComponentOrDocumentRootName = QQmlJSScope::RootDocumentNameType
using ConstScopeAndName = ScopeAndNameT<true>
using ScopeAndName = ScopeAndNameT<false>
using FunctionOrExpressionIdentifier = ConstScopeAndName
using Property = ConstScopeAndName
using Alias = ConstScopeAndName

Protected Member Functions

bool visit (QQmlJS::AST::ExpressionStatement *ast) override
void endVisit (QQmlJS::AST::ExpressionStatement *ast) override
bool visit (QQmlJS::AST::UiProgram *) override
void endVisit (QQmlJS::AST::UiProgram *) override
bool visit (QQmlJS::AST::UiObjectDefinition *) override
void endVisit (QQmlJS::AST::UiObjectDefinition *) override
bool visit (QQmlJS::AST::UiInlineComponent *) override
void endVisit (QQmlJS::AST::UiInlineComponent *) override
bool visit (QQmlJS::AST::UiPublicMember *) override
void endVisit (QQmlJS::AST::UiPublicMember *) override
bool visit (QQmlJS::AST::UiRequired *required) override
bool visit (QQmlJS::AST::UiScriptBinding *) override
void endVisit (QQmlJS::AST::UiScriptBinding *) override
bool visit (QQmlJS::AST::UiArrayBinding *) override
void endVisit (QQmlJS::AST::UiArrayBinding *) override
bool visit (QQmlJS::AST::UiEnumDeclaration *uied) override
bool visit (QQmlJS::AST::FunctionExpression *fexpr) override
void endVisit (QQmlJS::AST::FunctionExpression *) override
bool visit (QQmlJS::AST::UiSourceElement *) override
bool visit (QQmlJS::AST::FunctionDeclaration *fdecl) override
void endVisit (QQmlJS::AST::FunctionDeclaration *) override
bool visit (QQmlJS::AST::ClassExpression *ast) override
void endVisit (QQmlJS::AST::ClassExpression *) override
bool visit (QQmlJS::AST::UiImport *import) override
bool visit (QQmlJS::AST::UiPragma *pragma) override
bool visit (QQmlJS::AST::ClassDeclaration *ast) override
void endVisit (QQmlJS::AST::ClassDeclaration *ast) override
bool visit (QQmlJS::AST::ForStatement *ast) override
void endVisit (QQmlJS::AST::ForStatement *ast) override
bool visit (QQmlJS::AST::ForEachStatement *ast) override
void endVisit (QQmlJS::AST::ForEachStatement *ast) override
bool visit (QQmlJS::AST::Block *ast) override
void endVisit (QQmlJS::AST::Block *ast) override
bool visit (QQmlJS::AST::CaseBlock *ast) override
void endVisit (QQmlJS::AST::CaseBlock *ast) override
bool visit (QQmlJS::AST::Catch *ast) override
void endVisit (QQmlJS::AST::Catch *ast) override
bool visit (QQmlJS::AST::WithStatement *withStatement) override
void endVisit (QQmlJS::AST::WithStatement *ast) override
bool visit (QQmlJS::AST::VariableDeclarationList *vdl) override
bool visit (QQmlJS::AST::FormalParameterList *fpl) override
bool visit (QQmlJS::AST::UiObjectBinding *uiob) override
void endVisit (QQmlJS::AST::UiObjectBinding *uiob) override
bool visit (QQmlJS::AST::ExportDeclaration *exp) override
void endVisit (QQmlJS::AST::ExportDeclaration *exp) override
bool visit (QQmlJS::AST::ESModule *module) override
void endVisit (QQmlJS::AST::ESModule *module) override
bool visit (QQmlJS::AST::Program *program) override
void endVisit (QQmlJS::AST::Program *program) override
void endVisit (QQmlJS::AST::FieldMemberExpression *) override
bool visit (QQmlJS::AST::IdentifierExpression *idexp) override
bool visit (QQmlJS::AST::PatternElement *) override
bool visit (QQmlJS::AST::IfStatement *) override
void throwRecursionDepthError () override
virtual bool checkCustomParser (const QQmlJSScope::ConstPtr &scope)
void setScopeName (QQmlJSScope::Ptr &scope, QQmlJSScope::ScopeType type, const QString &name)
QQmlJSMetaMethod::RelativeFunctionIndex addFunctionOrExpression (const QQmlJSScope::ConstPtr &scope, const QString &name)
void forgetFunctionExpression (const QString &name)
int synthesizeCompilationUnitRuntimeFunctionIndices (const QQmlJSScope::Ptr &scope, int count) const
void populateRuntimeFunctionIndicesForDocument () const
void enterEnvironment (QQmlJSScope::ScopeType type, const QString &name, const QQmlJS::SourceLocation &location)
bool enterEnvironmentNonUnique (QQmlJSScope::ScopeType type, const QString &name, const QQmlJS::SourceLocation &location)
virtual void leaveEnvironment ()
template<typename ErrorHandler>
bool checkTypeResolved (const QQmlJSScope::ConstPtr &type, ErrorHandler handle)
bool checkTypeResolved (const QQmlJSScope::ConstPtr &type)
void warnUnresolvedType (const QQmlJSScope::ConstPtr &type) const
void warnMissingPropertyForBinding (const QString &property, const QQmlJS::SourceLocation &location, const std::optional< QQmlJSFixSuggestion > &fixSuggestion={})
QVector< QQmlJSAnnotationparseAnnotations (QQmlJS::AST::UiAnnotationList *list)
void setAllBindings ()
void addDefaultProperties ()
void processDefaultProperties ()
void processPropertyBindings ()
void checkRequiredProperties ()
void processPropertyTypes ()
void processMethodTypes ()
void processPropertyBindingObjects ()
void flushPendingSignalParameters ()
void breakInheritanceCycles (const QQmlJSScope::Ptr &scope)
void checkDeprecation (const QQmlJSScope::ConstPtr &scope)
void checkGroupedAndAttachedScopes (QQmlJSScope::ConstPtr scope)
bool rootScopeIsValid () const
virtual BindingExpressionParseResult parseBindingExpression (const QString &name, const QQmlJS::AST::Statement *statement, const QQmlJS::AST::UiPublicMember *associatedPropertyDefinition=nullptr)
bool isImportPrefix (QString prefix) const

Protected Attributes

QString m_implicitImportDirectory
QStringList m_qmldirFiles
QQmlJSScope::Ptr m_currentScope
const QQmlJSScope::Ptr m_exportedRootScope
QQmlJSImporterm_importer = nullptr
QQmlJSLoggerm_logger = nullptr
QQmlJSScope::InlineComponentOrDocumentRootName m_currentRootName
bool m_nextIsInlineComponent = false
bool m_rootIsSingleton = false
QQmlJSScope::Ptr m_savedBindingOuterScope
QQmlJSScope::ConstPtr m_globalScope
QQmlJSScopesById m_scopesById
QQmlJSImporter::ImportedTypes m_rootScopeImports
QList< QQmlJSScope::ConstPtrm_qmlTypes
QHash< QV4::CompiledData::Location, QQmlJSScope::ConstPtrm_scopesByIrLocation
QMultiHash< QString, QQmlJS::SourceLocationm_importTypeLocationMap
QMultiHash< QString, QQmlJS::SourceLocationm_importStaticModuleLocationMap
QSet< QQmlJS::SourceLocationm_importLocations
QSet< QStringm_usedTypes
QList< UnfinishedBindingm_bindings
QSet< std::pair< const QQmlJSScope *, QString > > misplacedJSIdentifiers
QHash< QQmlJSScope::ConstPtr, QList< QString > > m_functionsAndExpressions
bool m_thisScriptBindingIsJavaScript = false
QStack< FunctionOrExpressionIdentifierm_functionStack
QHash< FunctionOrExpressionIdentifier, int > m_innerFunctions
QDuplicateTracker< QQmlJSScope::ConstPtrm_unresolvedTypes
QVector< QQmlJSAnnotationm_pendingMethodAnnotations
QHash< QQmlJSScope::Ptr, QVector< QQmlJSScope::Ptr > > m_pendingDefaultProperties
QVector< PendingPropertyTypem_pendingPropertyTypes
QVector< PendingMethodTypeAnnotationsm_pendingMethodTypeAnnotations
QVector< PendingPropertyObjectBindingm_pendingPropertyObjectBindings
QVector< RequiredPropertym_requiredProperties
QVector< QQmlJSScope::Ptrm_objectBindingScopes
QVector< QQmlJSScope::Ptrm_objectDefinitionScopes
QHash< QQmlJSScope::Ptr, QVector< WithVisibilityScope< QString > > > m_propertyBindings
QVector< Aliasm_aliasDefinitions
QHash< Property, QList< Alias > > m_propertyAliases
QHash< QQmlJS::SourceLocation, QQmlJSMetaSignalHandlerm_signalHandlers
QQmlJS::SourceLocation m_pendingSignalHandler
QStringList m_seenModuleQualifiers
QHash< QStringView, QQmlJS::SourceLocationm_seenInlineComponents
Protected Attributes inherited from QQmlJS::AST::BaseVisitor
quint16 m_recursionDepth = 0

Private Member Functions

virtual void handleLiteralBinding (const QQmlJSMetaPropertyBinding &, const QQmlJS::AST::UiPublicMember *)

Friends

class QQmlJS::Dom::QQmlDomAstCreatorWithQQmlJSScope

Detailed Description

Definition at line 43 of file qqmljsimportvisitor_p.h.

Member Typedef Documentation

◆ Alias

Definition at line 246 of file qqmljsimportvisitor_p.h.

◆ ConstScopeAndName

Definition at line 241 of file qqmljsimportvisitor_p.h.

◆ FunctionOrExpressionIdentifier

◆ InlineComponentNameType

◆ InlineComponentOrDocumentRootName

◆ Property

Definition at line 245 of file qqmljsimportvisitor_p.h.

◆ RootDocumentNameType

◆ ScopeAndName

Definition at line 242 of file qqmljsimportvisitor_p.h.

Member Enumeration Documentation

◆ BindingExpressionParseResult

Enumerator
Invalid 
Script 
Literal 
Translation 

Definition at line 313 of file qqmljsimportvisitor_p.h.

◆ BindingForPropertyDefintion

Enumerator
Yes 
No 

Definition at line 314 of file qqmljsimportvisitor_p.h.

Constructor & Destructor Documentation

◆ QQmlJSImportVisitor() [1/2]

QQmlJSImportVisitor::QQmlJSImportVisitor ( const QQmlJSScope::Ptr & target,
QQmlJSImporter * importer,
QQmlJSLogger * logger,
const QString & implicitImportDirectory,
const QStringList & qmldirFiles = QStringList() )

Definition at line 203 of file qqmljsimportvisitor.cpp.

◆ QQmlJSImportVisitor() [2/2]

QQmlJSImportVisitor::QQmlJSImportVisitor ( QQmlJSImporter * importer,
QQmlJSLogger * logger,
const QString & implicitImportDirectory,
const QStringList & qmldirFiles = QStringList() )
inline

Definition at line 50 of file qqmljsimportvisitor_p.h.

◆ ~QQmlJSImportVisitor()

QQmlJSImportVisitor::~QQmlJSImportVisitor ( )
default

Member Function Documentation

◆ addDefaultProperties()

void QQmlJSImportVisitor::addDefaultProperties ( )
protected

Definition at line 1505 of file qqmljsimportvisitor.cpp.

◆ addFunctionOrExpression()

QQmlJSMetaMethod::RelativeFunctionIndex QQmlJSImportVisitor::addFunctionOrExpression ( const QQmlJSScope::ConstPtr & scope,
const QString & name )
protected

Records a JS function or a Script binding for a given scope. Returns an index of a just recorded function-or-expression.

See also
synthesizeCompilationUnitRuntimeFunctionIndices

Definition at line 1661 of file qqmljsimportvisitor.cpp.

◆ addressableScopes()

QQmlJSScopesById QQmlJSImportVisitor::addressableScopes ( ) const
inline

Definition at line 69 of file qqmljsimportvisitor_p.h.

◆ breakInheritanceCycles()

void QQmlJSImportVisitor::breakInheritanceCycles ( const QQmlJSScope::Ptr & scope)
protected

Definition at line 1545 of file qqmljsimportvisitor.cpp.

◆ checkCustomParser()

bool QQmlJSImportVisitor::checkCustomParser ( const QQmlJSScope::ConstPtr & scope)
protectedvirtual

Definition at line 1637 of file qqmljsimportvisitor.cpp.

◆ checkDeprecation()

void QQmlJSImportVisitor::checkDeprecation ( const QQmlJSScope::ConstPtr & scope)
protected

Definition at line 1588 of file qqmljsimportvisitor.cpp.

◆ checkGroupedAndAttachedScopes()

void QQmlJSImportVisitor::checkGroupedAndAttachedScopes ( QQmlJSScope::ConstPtr scope)
protected

Definition at line 1607 of file qqmljsimportvisitor.cpp.

◆ checkRequiredProperties()

void QQmlJSImportVisitor::checkRequiredProperties ( )
protected

Definition at line 1126 of file qqmljsimportvisitor.cpp.

◆ checkTypeResolved() [1/2]

bool QQmlJSImportVisitor::checkTypeResolved ( const QQmlJSScope::ConstPtr & type)
inlineprotected

Definition at line 285 of file qqmljsimportvisitor_p.h.

◆ checkTypeResolved() [2/2]

template<typename ErrorHandler>
bool QQmlJSImportVisitor::checkTypeResolved ( const QQmlJSScope::ConstPtr & type,
ErrorHandler handle )
inlineprotected

Definition at line 272 of file qqmljsimportvisitor_p.h.

◆ endVisit() [1/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::Block * ast)
overrideprotected

Definition at line 2956 of file qqmljsimportvisitor.cpp.

◆ endVisit() [2/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::CaseBlock * ast)
overrideprotected

Definition at line 2968 of file qqmljsimportvisitor.cpp.

◆ endVisit() [3/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::Catch * ast)
overrideprotected

Definition at line 2985 of file qqmljsimportvisitor.cpp.

◆ endVisit() [4/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::ClassDeclaration * ast)
overrideprotected

Definition at line 2916 of file qqmljsimportvisitor.cpp.

◆ endVisit() [5/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::ClassExpression * )
overrideprotected

Definition at line 2199 of file qqmljsimportvisitor.cpp.

◆ endVisit() [6/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::ESModule * module)
overrideprotected

Definition at line 3235 of file qqmljsimportvisitor.cpp.

◆ endVisit() [7/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::ExportDeclaration * exp)
overrideprotected

Definition at line 3217 of file qqmljsimportvisitor.cpp.

◆ endVisit() [8/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::ExpressionStatement * ast)
overrideprotected

Definition at line 1771 of file qqmljsimportvisitor.cpp.

◆ endVisit() [9/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::FieldMemberExpression * fieldMember)
overrideprotected

Definition at line 3257 of file qqmljsimportvisitor.cpp.

◆ endVisit() [10/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::ForEachStatement * ast)
overrideprotected

Definition at line 2940 of file qqmljsimportvisitor.cpp.

◆ endVisit() [11/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::ForStatement * ast)
overrideprotected

Definition at line 2928 of file qqmljsimportvisitor.cpp.

◆ endVisit() [12/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::FunctionDeclaration * fdecl)
overrideprotected

Definition at line 2183 of file qqmljsimportvisitor.cpp.

◆ endVisit() [13/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::FunctionExpression * fexpr)
overrideprotected

Definition at line 2156 of file qqmljsimportvisitor.cpp.

◆ endVisit() [14/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::Program * program)
overrideprotected

Definition at line 3251 of file qqmljsimportvisitor.cpp.

◆ endVisit() [15/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::UiArrayBinding * arrayBinding)
overrideprotected

Definition at line 2627 of file qqmljsimportvisitor.cpp.

◆ endVisit() [16/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::UiInlineComponent * component)
overrideprotected

Definition at line 1899 of file qqmljsimportvisitor.cpp.

◆ endVisit() [17/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::UiObjectBinding * uiob)
overrideprotected

Definition at line 3115 of file qqmljsimportvisitor.cpp.

◆ endVisit() [18/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::UiObjectDefinition * )
overrideprotected

Definition at line 1869 of file qqmljsimportvisitor.cpp.

◆ endVisit() [19/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::UiProgram * )
overrideprotected

Definition at line 572 of file qqmljsimportvisitor.cpp.

◆ endVisit() [20/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::UiPublicMember * publicMember)
overrideprotected

Definition at line 2035 of file qqmljsimportvisitor.cpp.

◆ endVisit() [21/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::UiScriptBinding * )
overrideprotected

Definition at line 2599 of file qqmljsimportvisitor.cpp.

◆ endVisit() [22/22]

void QQmlJSImportVisitor::endVisit ( QQmlJS::AST::WithStatement * ast)
overrideprotected

Definition at line 3003 of file qqmljsimportvisitor.cpp.

◆ enterEnvironment()

void QQmlJSImportVisitor::enterEnvironment ( QQmlJSScope::ScopeType type,
const QString & name,
const QQmlJS::SourceLocation & location )
protected

Definition at line 266 of file qqmljsimportvisitor.cpp.

◆ enterEnvironmentNonUnique()

bool QQmlJSImportVisitor::enterEnvironmentNonUnique ( QQmlJSScope::ScopeType type,
const QString & name,
const QQmlJS::SourceLocation & location )
protected

Definition at line 275 of file qqmljsimportvisitor.cpp.

◆ flushPendingSignalParameters()

void QQmlJSImportVisitor::flushPendingSignalParameters ( )
protected

Definition at line 1642 of file qqmljsimportvisitor.cpp.

◆ forgetFunctionExpression()

void QQmlJSImportVisitor::forgetFunctionExpression ( const QString & name)
protected

Removes last FunctionOrExpressionIdentifier from m_functionStack, performing some checks on name.

Note
name must match the name added via addFunctionOrExpression().
See also
addFunctionOrExpression, synthesizeCompilationUnitRuntimeFunctionIndices

Definition at line 1688 of file qqmljsimportvisitor.cpp.

◆ handleLiteralBinding()

void QQmlJSImportVisitor::handleLiteralBinding ( const QQmlJSMetaPropertyBinding & binding,
const QQmlJS::AST::UiPublicMember * associatedPropertyDefinition )
privatevirtual

Reimplemented in QQmlJS::LinterVisitor.

Definition at line 2419 of file qqmljsimportvisitor.cpp.

◆ implicitImportDirectory()

QString QQmlJSImportVisitor::implicitImportDirectory ( const QString & localFile,
QQmlJSResourceFileMapper * mapper )
static

Definition at line 478 of file qqmljsimportvisitor.cpp.

◆ importer() [1/2]

QQmlJSImporter * QQmlJSImportVisitor::importer ( )
inline

Definition at line 84 of file qqmljsimportvisitor_p.h.

◆ importer() [2/2]

const QQmlJSImporter * QQmlJSImportVisitor::importer ( ) const
inline

Definition at line 85 of file qqmljsimportvisitor_p.h.

◆ imports()

QQmlJSImporter::ImportedTypes QQmlJSImportVisitor::imports ( ) const
inline

Definition at line 68 of file qqmljsimportvisitor_p.h.

◆ isImportPrefix()

bool QQmlJSImportVisitor::isImportPrefix ( QString prefix) const
protected

Definition at line 2351 of file qqmljsimportvisitor.cpp.

◆ leaveEnvironment()

void QQmlJSImportVisitor::leaveEnvironment ( )
protectedvirtual

Reimplemented in QQmlJS::LinterVisitor.

Definition at line 302 of file qqmljsimportvisitor.cpp.

◆ logger() [1/2]

QQmlJSLogger * QQmlJSImportVisitor::logger ( )
inline

Definition at line 66 of file qqmljsimportvisitor_p.h.

◆ logger() [2/2]

const QQmlJSLogger * QQmlJSImportVisitor::logger ( ) const
inline

Definition at line 65 of file qqmljsimportvisitor_p.h.

◆ parseAnnotations()

QVector< QQmlJSAnnotation > QQmlJSImportVisitor::parseAnnotations ( QQmlJS::AST::UiAnnotationList * list)
protected

Definition at line 645 of file qqmljsimportvisitor.cpp.

◆ parseBindingExpression()

QQmlJSImportVisitor::BindingExpressionParseResult QQmlJSImportVisitor::parseBindingExpression ( const QString & name,
const QQmlJS::AST::Statement * statement,
const QQmlJS::AST::UiPublicMember * associatedPropertyDefinition = nullptr )
protectedvirtual

Reimplemented in QQmlJS::LinterVisitor.

Definition at line 2238 of file qqmljsimportvisitor.cpp.

◆ populateRuntimeFunctionIndicesForDocument()

void QQmlJSImportVisitor::populateRuntimeFunctionIndicesForDocument ( ) const
protected

Definition at line 1752 of file qqmljsimportvisitor.cpp.

◆ postVisit()

void QQmlJS::AST::Visitor::postVisit ( Node * )
inlineoverride

Definition at line 205 of file qqmljsastvisitor_p.h.

◆ preVisit()

bool QQmlJS::AST::Visitor::preVisit ( Node * )
inlineoverride

Definition at line 204 of file qqmljsastvisitor_p.h.

◆ processDefaultProperties()

void QQmlJSImportVisitor::processDefaultProperties ( )
protected

Definition at line 727 of file qqmljsimportvisitor.cpp.

◆ processMethodTypes()

void QQmlJSImportVisitor::processMethodTypes ( )
protected

Definition at line 847 of file qqmljsimportvisitor.cpp.

◆ processPropertyBindingObjects()

void QQmlJSImportVisitor::processPropertyBindingObjects ( )
protected

Definition at line 930 of file qqmljsimportvisitor.cpp.

◆ processPropertyBindings()

void QQmlJSImportVisitor::processPropertyBindings ( )
protected

Definition at line 1298 of file qqmljsimportvisitor.cpp.

◆ processPropertyTypes()

void QQmlJSImportVisitor::processPropertyTypes ( )
protected

Definition at line 827 of file qqmljsimportvisitor.cpp.

◆ qmlTypes()

QList< QQmlJSScope::ConstPtr > QQmlJSImportVisitor::qmlTypes ( ) const
inline

Definition at line 74 of file qqmljsimportvisitor_p.h.

◆ result()

QQmlJSScope::Ptr QQmlJSImportVisitor::result ( ) const
inline

Definition at line 63 of file qqmljsimportvisitor_p.h.

◆ rootScopeIsValid()

bool QQmlJSImportVisitor::rootScopeIsValid ( ) const
inlineprotected

Definition at line 311 of file qqmljsimportvisitor_p.h.

◆ scopesBylocation()

QHash< QV4::CompiledData::Location, QQmlJSScope::ConstPtr > QQmlJSImportVisitor::scopesBylocation ( ) const
inline

Definition at line 75 of file qqmljsimportvisitor_p.h.

◆ seenModuleQualifiers()

QStringList QQmlJSImportVisitor::seenModuleQualifiers ( ) const
inline

Definition at line 94 of file qqmljsimportvisitor_p.h.

◆ setAllBindings()

void QQmlJSImportVisitor::setAllBindings ( )
protected

Definition at line 676 of file qqmljsimportvisitor.cpp.

◆ setScopeName()

void QQmlJSImportVisitor::setScopeName ( QQmlJSScope::Ptr & scope,
QQmlJSScope::ScopeType type,
const QString & name )
protected

Sets the name of scope to name based on type.

Definition at line 120 of file qqmljsimportvisitor.cpp.

◆ signalHandlers()

QHash< QQmlJS::SourceLocation, QQmlJSMetaSignalHandler > QQmlJSImportVisitor::signalHandlers ( ) const
inline

Definition at line 70 of file qqmljsimportvisitor_p.h.

◆ synthesizeCompilationUnitRuntimeFunctionIndices()

int QQmlJSImportVisitor::synthesizeCompilationUnitRuntimeFunctionIndices ( const QQmlJSScope::Ptr & scope,
int count ) const
protected

Sets absolute runtime function indices for scope based on count (document-level variable). Returns count incremented by the number of runtime functions that the current scope has.

Note
Not all scopes are considered as the function is compatible with the compilation unit output. The runtime functions are only recorded for QmlIR::Object (even if they don't strictly belong to it). Thus, in QQmlJSScope terms, we are only interested in QML scopes, group and attached property scopes.

Definition at line 1709 of file qqmljsimportvisitor.cpp.

◆ throwRecursionDepthError()

void QQmlJSImportVisitor::throwRecursionDepthError ( )
overrideprotectedvirtual

Implements QQmlJS::AST::BaseVisitor.

Definition at line 2903 of file qqmljsimportvisitor.cpp.

◆ visit() [1/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::Block * ast)
overrideprotected

Definition at line 2945 of file qqmljsimportvisitor.cpp.

◆ visit() [2/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::CaseBlock * ast)
overrideprotected

Definition at line 2961 of file qqmljsimportvisitor.cpp.

◆ visit() [3/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::Catch * ast)
overrideprotected

Definition at line 2973 of file qqmljsimportvisitor.cpp.

◆ visit() [4/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::ClassDeclaration * ast)
overrideprotected

Definition at line 2909 of file qqmljsimportvisitor.cpp.

◆ visit() [5/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::ClassExpression * ast)
overrideprotected

Definition at line 2189 of file qqmljsimportvisitor.cpp.

◆ visit() [6/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::ESModule * module)
overrideprotected

Definition at line 3224 of file qqmljsimportvisitor.cpp.

◆ visit() [7/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::ExportDeclaration * exp)
overrideprotected

Definition at line 3208 of file qqmljsimportvisitor.cpp.

◆ visit() [8/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::ExpressionStatement * ast)
overrideprotected

Definition at line 1761 of file qqmljsimportvisitor.cpp.

◆ visit() [9/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::ForEachStatement * ast)
overrideprotected

Definition at line 2933 of file qqmljsimportvisitor.cpp.

◆ visit() [10/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::FormalParameterList * fpl)
overrideprotected

Definition at line 3040 of file qqmljsimportvisitor.cpp.

◆ visit() [11/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::ForStatement * ast)
overrideprotected

Definition at line 2921 of file qqmljsimportvisitor.cpp.

◆ visit() [12/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::FunctionDeclaration * fdecl)
overrideprotected

Definition at line 2168 of file qqmljsimportvisitor.cpp.

◆ visit() [13/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::FunctionExpression * fexpr)
overrideprotected

Definition at line 2150 of file qqmljsimportvisitor.cpp.

◆ visit() [14/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::IdentifierExpression * idexp)
overrideprotected

Definition at line 3273 of file qqmljsimportvisitor.cpp.

◆ visit() [15/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::IfStatement * statement)
overrideprotected

Definition at line 3309 of file qqmljsimportvisitor.cpp.

◆ visit() [16/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::PatternElement * element)
overrideprotected

Definition at line 3283 of file qqmljsimportvisitor.cpp.

◆ visit() [17/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::Program * program)
overrideprotected

Definition at line 3241 of file qqmljsimportvisitor.cpp.

◆ visit() [18/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiArrayBinding * arrayBinding)
overrideprotected

Definition at line 2616 of file qqmljsimportvisitor.cpp.

◆ visit() [19/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiEnumDeclaration * uied)
overrideprotected

Definition at line 2666 of file qqmljsimportvisitor.cpp.

◆ visit() [20/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiImport * import)
overrideprotected

Definition at line 2760 of file qqmljsimportvisitor.cpp.

◆ visit() [21/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiInlineComponent * component)
overrideprotected

Definition at line 1875 of file qqmljsimportvisitor.cpp.

◆ visit() [22/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiObjectBinding * uiob)
overrideprotected

Definition at line 3056 of file qqmljsimportvisitor.cpp.

◆ visit() [23/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiObjectDefinition * definition)
overrideprotected

Definition at line 1792 of file qqmljsimportvisitor.cpp.

◆ visit() [24/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiPragma * pragma)
overrideprotected

Definition at line 2846 of file qqmljsimportvisitor.cpp.

◆ visit() [25/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiProgram * )
overrideprotected

Definition at line 560 of file qqmljsimportvisitor.cpp.

◆ visit() [26/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiPublicMember * publicMember)
overrideprotected

Definition at line 1909 of file qqmljsimportvisitor.cpp.

◆ visit() [27/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiRequired * required)
overrideprotected

Definition at line 2045 of file qqmljsimportvisitor.cpp.

◆ visit() [28/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiScriptBinding * scriptBinding)
overrideprotected

Definition at line 2463 of file qqmljsimportvisitor.cpp.

◆ visit() [29/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::UiSourceElement * srcElement)
overrideprotected

Definition at line 2162 of file qqmljsimportvisitor.cpp.

◆ visit() [30/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::VariableDeclarationList * vdl)
overrideprotected

Definition at line 3008 of file qqmljsimportvisitor.cpp.

◆ visit() [31/31]

bool QQmlJSImportVisitor::visit ( QQmlJS::AST::WithStatement * withStatement)
overrideprotected

Definition at line 2990 of file qqmljsimportvisitor.cpp.

◆ warnMissingPropertyForBinding()

void QQmlJSImportVisitor::warnMissingPropertyForBinding ( const QString & property,
const QQmlJS::SourceLocation & location,
const std::optional< QQmlJSFixSuggestion > & fixSuggestion = {} )
protected

Definition at line 314 of file qqmljsimportvisitor.cpp.

◆ warnUnresolvedType()

void QQmlJSImportVisitor::warnUnresolvedType ( const QQmlJSScope::ConstPtr & type) const
protected

Definition at line 307 of file qqmljsimportvisitor.cpp.

◆ QQmlJS::Dom::QQmlDomAstCreatorWithQQmlJSScope

Definition at line 424 of file qqmljsimportvisitor_p.h.

Member Data Documentation

◆ m_aliasDefinitions

QVector<Alias> QQmlJSImportVisitor::m_aliasDefinitions
protected

Definition at line 383 of file qqmljsimportvisitor_p.h.

◆ m_bindings

QList<UnfinishedBinding> QQmlJSImportVisitor::m_bindings
protected

Definition at line 199 of file qqmljsimportvisitor_p.h.

◆ m_currentRootName

QQmlJSScope::InlineComponentOrDocumentRootName QQmlJSImportVisitor::m_currentRootName
protected
Initial value:

Definition at line 176 of file qqmljsimportvisitor_p.h.

◆ m_currentScope

QQmlJSScope::Ptr QQmlJSImportVisitor::m_currentScope
protected

Definition at line 168 of file qqmljsimportvisitor_p.h.

◆ m_exportedRootScope

const QQmlJSScope::Ptr QQmlJSImportVisitor::m_exportedRootScope
protected

Definition at line 169 of file qqmljsimportvisitor_p.h.

◆ m_functionsAndExpressions

QHash<QQmlJSScope::ConstPtr, QList<QString> > QQmlJSImportVisitor::m_functionsAndExpressions
protected

Definition at line 204 of file qqmljsimportvisitor_p.h.

◆ m_functionStack

QStack<FunctionOrExpressionIdentifier> QQmlJSImportVisitor::m_functionStack
protected

Definition at line 250 of file qqmljsimportvisitor_p.h.

◆ m_globalScope

QQmlJSScope::ConstPtr QQmlJSImportVisitor::m_globalScope
protected

Definition at line 181 of file qqmljsimportvisitor_p.h.

◆ m_implicitImportDirectory

QString QQmlJSImportVisitor::m_implicitImportDirectory
protected

Definition at line 166 of file qqmljsimportvisitor_p.h.

◆ m_importer

QQmlJSImporter* QQmlJSImportVisitor::m_importer = nullptr
protected

Definition at line 170 of file qqmljsimportvisitor_p.h.

◆ m_importLocations

QSet<QQmlJS::SourceLocation> QQmlJSImportVisitor::m_importLocations
protected

Definition at line 195 of file qqmljsimportvisitor_p.h.

◆ m_importStaticModuleLocationMap

QMultiHash<QString, QQmlJS::SourceLocation> QQmlJSImportVisitor::m_importStaticModuleLocationMap
protected

Definition at line 193 of file qqmljsimportvisitor_p.h.

◆ m_importTypeLocationMap

QMultiHash<QString, QQmlJS::SourceLocation> QQmlJSImportVisitor::m_importTypeLocationMap
protected

Definition at line 191 of file qqmljsimportvisitor_p.h.

◆ m_innerFunctions

QHash<FunctionOrExpressionIdentifier, int> QQmlJSImportVisitor::m_innerFunctions
protected

Definition at line 252 of file qqmljsimportvisitor_p.h.

◆ m_logger

QQmlJSLogger* QQmlJSImportVisitor::m_logger = nullptr
protected

Definition at line 171 of file qqmljsimportvisitor_p.h.

◆ m_nextIsInlineComponent

bool QQmlJSImportVisitor::m_nextIsInlineComponent = false
protected

Definition at line 178 of file qqmljsimportvisitor_p.h.

◆ m_objectBindingScopes

QVector<QQmlJSScope::Ptr> QQmlJSImportVisitor::m_objectBindingScopes
protected

Definition at line 379 of file qqmljsimportvisitor_p.h.

◆ m_objectDefinitionScopes

QVector<QQmlJSScope::Ptr> QQmlJSImportVisitor::m_objectDefinitionScopes
protected

Definition at line 380 of file qqmljsimportvisitor_p.h.

◆ m_pendingDefaultProperties

QHash<QQmlJSScope::Ptr, QVector<QQmlJSScope::Ptr> > QQmlJSImportVisitor::m_pendingDefaultProperties
protected

Definition at line 374 of file qqmljsimportvisitor_p.h.

◆ m_pendingMethodAnnotations

QVector<QQmlJSAnnotation> QQmlJSImportVisitor::m_pendingMethodAnnotations
protected

Definition at line 321 of file qqmljsimportvisitor_p.h.

◆ m_pendingMethodTypeAnnotations

QVector<PendingMethodTypeAnnotations> QQmlJSImportVisitor::m_pendingMethodTypeAnnotations
protected

Definition at line 376 of file qqmljsimportvisitor_p.h.

◆ m_pendingPropertyObjectBindings

QVector<PendingPropertyObjectBinding> QQmlJSImportVisitor::m_pendingPropertyObjectBindings
protected

Definition at line 377 of file qqmljsimportvisitor_p.h.

◆ m_pendingPropertyTypes

QVector<PendingPropertyType> QQmlJSImportVisitor::m_pendingPropertyTypes
protected

Definition at line 375 of file qqmljsimportvisitor_p.h.

◆ m_pendingSignalHandler

QQmlJS::SourceLocation QQmlJSImportVisitor::m_pendingSignalHandler
protected

Definition at line 387 of file qqmljsimportvisitor_p.h.

◆ m_propertyAliases

QHash<Property, QList<Alias> > QQmlJSImportVisitor::m_propertyAliases
protected

Definition at line 384 of file qqmljsimportvisitor_p.h.

◆ m_propertyBindings

QHash<QQmlJSScope::Ptr, QVector<WithVisibilityScope<QString> > > QQmlJSImportVisitor::m_propertyBindings
protected

Definition at line 382 of file qqmljsimportvisitor_p.h.

◆ m_qmldirFiles

QStringList QQmlJSImportVisitor::m_qmldirFiles
protected

Definition at line 167 of file qqmljsimportvisitor_p.h.

◆ m_qmlTypes

QList<QQmlJSScope::ConstPtr> QQmlJSImportVisitor::m_qmlTypes
protected

Definition at line 184 of file qqmljsimportvisitor_p.h.

◆ m_requiredProperties

QVector<RequiredProperty> QQmlJSImportVisitor::m_requiredProperties
protected

Definition at line 378 of file qqmljsimportvisitor_p.h.

◆ m_rootIsSingleton

bool QQmlJSImportVisitor::m_rootIsSingleton = false
protected

Definition at line 179 of file qqmljsimportvisitor_p.h.

◆ m_rootScopeImports

QQmlJSImporter::ImportedTypes QQmlJSImportVisitor::m_rootScopeImports
protected

Definition at line 183 of file qqmljsimportvisitor_p.h.

◆ m_savedBindingOuterScope

QQmlJSScope::Ptr QQmlJSImportVisitor::m_savedBindingOuterScope
protected

Definition at line 180 of file qqmljsimportvisitor_p.h.

◆ m_scopesById

QQmlJSScopesById QQmlJSImportVisitor::m_scopesById
protected

Definition at line 182 of file qqmljsimportvisitor_p.h.

◆ m_scopesByIrLocation

QHash<QV4::CompiledData::Location, QQmlJSScope::ConstPtr> QQmlJSImportVisitor::m_scopesByIrLocation
protected

Definition at line 188 of file qqmljsimportvisitor_p.h.

◆ m_seenInlineComponents

QHash<QStringView, QQmlJS::SourceLocation> QQmlJSImportVisitor::m_seenInlineComponents
protected

Definition at line 389 of file qqmljsimportvisitor_p.h.

◆ m_seenModuleQualifiers

QStringList QQmlJSImportVisitor::m_seenModuleQualifiers
protected

Definition at line 388 of file qqmljsimportvisitor_p.h.

◆ m_signalHandlers

QHash<QQmlJS::SourceLocation, QQmlJSMetaSignalHandler> QQmlJSImportVisitor::m_signalHandlers
protected

Definition at line 386 of file qqmljsimportvisitor_p.h.

◆ m_thisScriptBindingIsJavaScript

bool QQmlJSImportVisitor::m_thisScriptBindingIsJavaScript = false
protected

Definition at line 249 of file qqmljsimportvisitor_p.h.

◆ m_unresolvedTypes

QDuplicateTracker<QQmlJSScope::ConstPtr> QQmlJSImportVisitor::m_unresolvedTypes
protected

Definition at line 270 of file qqmljsimportvisitor_p.h.

◆ m_usedTypes

QSet<QString> QQmlJSImportVisitor::m_usedTypes
protected

Definition at line 197 of file qqmljsimportvisitor_p.h.

◆ misplacedJSIdentifiers

QSet<std::pair<const QQmlJSScope *, QString> > QQmlJSImportVisitor::misplacedJSIdentifiers
protected

Definition at line 200 of file qqmljsimportvisitor_p.h.


The documentation for this class was generated from the following files: