Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQmlJSImporter Class Reference

#include <qqmljsimporter_p.h>

+ Collaboration diagram for QQmlJSImporter:

Public Types

using ImportedTypes = QQmlJSScope::ContextualTypes
 
using ImportVisitorCreator = QQmlJSImportVisitor *(*)(const QQmlJSScope::Ptr &, QQmlJSImporter *, QQmlJSLogger *, const QString &, const QStringList &)
 

Public Member Functions

 QQmlJSImporter (const QStringList &importPaths, QQmlJSResourceFileMapper *mapper, bool useOptionalImports=false)
 
QQmlJSResourceFileMapperresourceFileMapper () const
 
void setResourceFileMapper (QQmlJSResourceFileMapper *mapper)
 
QQmlJSResourceFileMappermetaDataMapper () const
 
void setMetaDataMapper (QQmlJSResourceFileMapper *mapper)
 
ImportedTypes importBuiltins ()
 Imports builtins.qmltypes and jsroot.qmltypes found in any of the import paths.
 
void importQmldirs (const QStringList &qmltypesFiles)
 Imports types from the specified qmltypesFiles.
 
QQmlJSScope::Ptr importFile (const QString &file)
 
ImportedTypes importDirectory (const QString &directory, const QString &prefix=QString())
 
QHash< QString, QQmlJSScope::PtrimportedFiles () const
 
ImportedTypes importModule (const QString &module, const QString &prefix=QString(), QTypeRevision version=QTypeRevision(), QStringList *staticModuleList=nullptr)
 
ImportedTypes builtinInternalNames ()
 
QList< QQmlJS::DiagnosticMessagetakeWarnings ()
 
QList< QQmlJS::DiagnosticMessagetakeGlobalWarnings ()
 
QStringList importPaths () const
 
void setImportPaths (const QStringList &importPaths)
 
void clearCache ()
 
QQmlJSScope::ConstPtr jsGlobalObject () const
 
std::unique_ptr< QQmlJSImportVisitormakeImportVisitor (const QQmlJSScope::Ptr &target, QQmlJSImporter *importer, QQmlJSLogger *logger, const QString &implicitImportDirectory, const QStringList &qmldirFiles=QStringList())
 
void setImportVisitorCreator (ImportVisitorCreator create)
 

Friends

class QDeferredFactory< QQmlJSScope >
 

Detailed Description

Definition at line 29 of file qqmljsimporter_p.h.

Member Typedef Documentation

◆ ImportedTypes

◆ ImportVisitorCreator

Constructor & Destructor Documentation

◆ QQmlJSImporter()

QQmlJSImporter::QQmlJSImporter ( const QStringList importPaths,
QQmlJSResourceFileMapper mapper,
bool  useOptionalImports = false 
)

Definition at line 132 of file qqmljsimporter.cpp.

Member Function Documentation

◆ builtinInternalNames()

QQmlJSImporter::ImportedTypes QQmlJSImporter::builtinInternalNames ( )

Definition at line 659 of file qqmljsimporter.cpp.

Referenced by QQmlSA::GenericPass::resolveBuiltinType().

+ Here is the caller graph for this function:

◆ clearCache()

void QQmlJSImporter::clearCache ( )

Definition at line 836 of file qqmljsimporter.cpp.

References QHash< Key, T >::clear().

Referenced by QQmlJSLinter::lintModule().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importBuiltins()

QQmlJSImporter::ImportedTypes QQmlJSImporter::importBuiltins ( )

Imports builtins.qmltypes and jsroot.qmltypes found in any of the import paths.

Definition at line 513 of file qqmljsimporter.cpp.

Referenced by QQmlSA::GenericPass::resolveBuiltinType().

+ Here is the caller graph for this function:

◆ importDirectory()

QQmlJSImporter::ImportedTypes QQmlJSImporter::importDirectory ( const QString directory,
const QString prefix = QString() 
)

Definition at line 814 of file qqmljsimporter.cpp.

References directory, and QQmlJSScope::ContextualTypes::INTERNAL.

◆ importedFiles()

QHash< QString, QQmlJSScope::Ptr > QQmlJSImporter::importedFiles ( ) const
inline

Definition at line 50 of file qqmljsimporter_p.h.

◆ importFile()

QQmlJSScope::Ptr QQmlJSImporter::importFile ( const QString file)

Definition at line 809 of file qqmljsimporter.cpp.

References file.

◆ importModule()

QQmlJSImporter::ImportedTypes QQmlJSImporter::importModule ( const QString module,
const QString prefix = QString(),
QTypeRevision  version = QTypeRevision(),
QStringList staticModuleList = nullptr 
)

Definition at line 630 of file qqmljsimporter.cpp.

References QList< T >::append(), prefixedName(), QStringLiteral, and QtWarningMsg.

Referenced by QQmlJSLinter::lintModule(), QQmlSA::PassManagerPrivate::registerPropertyPass(), QQmlSA::GenericPass::resolveType(), and QQmlJSImportVisitor::visit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importPaths()

QStringList QQmlJSImporter::importPaths ( ) const
inline

Definition at line 72 of file qqmljsimporter_p.h.

Referenced by QQmlJSLinter::lintFile(), QQmlJSLinter::lintModule(), and setImportPaths().

+ Here is the caller graph for this function:

◆ importQmldirs()

void QQmlJSImporter::importQmldirs ( const QStringList qmltypesFiles)

Imports types from the specified qmltypesFiles.

Definition at line 594 of file qqmljsimporter.cpp.

References QList< T >::append(), file, QHash< Key, T >::insert(), QStringLiteral, QtWarningMsg, QLatin1StringView::size(), and SlashQmldir.

+ Here is the call graph for this function:

◆ jsGlobalObject()

QQmlJSScope::ConstPtr QQmlJSImporter::jsGlobalObject ( ) const

Definition at line 844 of file qqmljsimporter.cpp.

Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver().

+ Here is the caller graph for this function:

◆ makeImportVisitor()

std::unique_ptr< QQmlJSImportVisitor > QQmlJSImporter::makeImportVisitor ( const QQmlJSScope::Ptr target,
QQmlJSImporter importer,
QQmlJSLogger logger,
const QString implicitImportDirectory,
const QStringList qmldirFiles = QStringList() 
)

Definition at line 869 of file qqmljsimporter.cpp.

Referenced by QQmlJSTypeReader::operator()().

+ Here is the caller graph for this function:

◆ metaDataMapper()

QQmlJSResourceFileMapper * QQmlJSImporter::metaDataMapper ( ) const
inline

Definition at line 40 of file qqmljsimporter_p.h.

Referenced by QQmlJSUtils::sourceDirectoryPath().

+ Here is the caller graph for this function:

◆ resourceFileMapper()

QQmlJSResourceFileMapper * QQmlJSImporter::resourceFileMapper ( ) const
inline

Definition at line 37 of file qqmljsimporter_p.h.

Referenced by QQmlJSTypeReader::operator()(), and QQmlJSUtils::sourceDirectoryPath().

+ Here is the caller graph for this function:

◆ setImportPaths()

void QQmlJSImporter::setImportPaths ( const QStringList importPaths)

Definition at line 825 of file qqmljsimporter.cpp.

References QHash< Key, T >::clear(), and importPaths().

Referenced by QQmlJSLinter::lintFile(), and QQmlJSLinter::lintModule().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setImportVisitorCreator()

void QQmlJSImporter::setImportVisitorCreator ( ImportVisitorCreator  create)
inline

Definition at line 86 of file qqmljsimporter_p.h.

◆ setMetaDataMapper()

void QQmlJSImporter::setMetaDataMapper ( QQmlJSResourceFileMapper mapper)
inline

Definition at line 41 of file qqmljsimporter_p.h.

References mapper.

◆ setResourceFileMapper()

void QQmlJSImporter::setResourceFileMapper ( QQmlJSResourceFileMapper mapper)
inline

Definition at line 38 of file qqmljsimporter_p.h.

References mapper.

Referenced by QQmlJSLinter::lintFile(), and QQmlJSLinter::lintModule().

+ Here is the caller graph for this function:

◆ takeGlobalWarnings()

QList< QQmlJS::DiagnosticMessage > QQmlJSImporter::takeGlobalWarnings ( )
inline

Definition at line 65 of file qqmljsimporter_p.h.

Referenced by QQmlJSLinter::lintFile(), and QQmlJSLinter::lintModule().

+ Here is the caller graph for this function:

◆ takeWarnings()

QList< QQmlJS::DiagnosticMessage > QQmlJSImporter::takeWarnings ( )
inline

Definition at line 58 of file qqmljsimporter_p.h.

Referenced by QQmlJSLinter::lintModule().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QDeferredFactory< QQmlJSScope >

friend class QDeferredFactory< QQmlJSScope >
friend

Definition at line 86 of file qqmljsimporter_p.h.


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