Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQmlJSImporter Class Reference

#include <qqmljsimporter_p.h>

+ Collaboration diagram for QQmlJSImporter:

Classes

struct  ImportVisitorPrerequisites
 

Public Types

using ImportedTypes = QQmlJS::ContextualTypes
 
using ImportVisitor
 

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
 
void runImportVisitor (QQmlJS::AST::Node *rootNode, const ImportVisitorPrerequisites &prerequisites)
 
void setImportVisitor (ImportVisitor visitor)
 

Friends

class QDeferredFactory< QQmlJSScope >
 

Detailed Description

Definition at line 67 of file qqmljsimporter_p.h.

Member Typedef Documentation

◆ ImportedTypes

◆ ImportVisitor

Initial value:
std::function<void(QQmlJS::AST::Node *rootNode, QQmlJSImporter *self,
const ImportVisitorPrerequisites &prerequisites)>
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void

When a qml file gets lazily loaded, it will be lexed and parsed and finally be constructed via an ImportVisitor. By default, this is done via the QQmlJSImportVisitor, but can also be done via other import visitors like QmltcVisitor, which is used by qmltc to compile a QML file, or QQmlDomAstCreatorWithQQmlJSScope, which is used to construct the Dom of lazily loaded QML files.

Definition at line 145 of file qqmljsimporter_p.h.

Constructor & Destructor Documentation

◆ QQmlJSImporter()

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

Definition at line 164 of file qqmljsimporter.cpp.

References QQmlJS::AST::Node::accept().

+ Here is the call graph for this function:

Member Function Documentation

◆ builtinInternalNames()

QQmlJSImporter::ImportedTypes QQmlJSImporter::builtinInternalNames ( )

Definition at line 750 of file qqmljsimporter.cpp.

◆ clearCache()

void QQmlJSImporter::clearCache ( )

Definition at line 927 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 603 of file qqmljsimporter.cpp.

◆ importDirectory()

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

Definition at line 905 of file qqmljsimporter.cpp.

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

◆ importedFiles()

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

Definition at line 88 of file qqmljsimporter_p.h.

◆ importFile()

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

Definition at line 900 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 721 of file qqmljsimporter.cpp.

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

Referenced by QQmlJSLinter::lintModule(), 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 110 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 684 of file qqmljsimporter.cpp.

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

+ Here is the call graph for this function:

◆ jsGlobalObject()

QQmlJSScope::ConstPtr QQmlJSImporter::jsGlobalObject ( ) const

Definition at line 935 of file qqmljsimporter.cpp.

Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver().

+ Here is the caller graph for this function:

◆ metaDataMapper()

QQmlJSResourceFileMapper * QQmlJSImporter::metaDataMapper ( ) const
inline

Definition at line 78 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 75 of file qqmljsimporter_p.h.

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

+ Here is the caller graph for this function:

◆ runImportVisitor()

void QQmlJSImporter::runImportVisitor ( QQmlJS::AST::Node * rootNode,
const ImportVisitorPrerequisites & prerequisites )

Definition at line 953 of file qqmljsimporter.cpp.

Referenced by QQmlJSTypeReader::operator()().

+ Here is the caller graph for this function:

◆ setImportPaths()

void QQmlJSImporter::setImportPaths ( const QStringList & importPaths)

Definition at line 916 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:

◆ setImportVisitor()

void QQmlJSImporter::setImportVisitor ( ImportVisitor visitor)
inline

Definition at line 148 of file qqmljsimporter_p.h.

◆ setMetaDataMapper()

void QQmlJSImporter::setMetaDataMapper ( QQmlJSResourceFileMapper * mapper)
inline

Definition at line 79 of file qqmljsimporter_p.h.

References mapper.

◆ setResourceFileMapper()

void QQmlJSImporter::setResourceFileMapper ( QQmlJSResourceFileMapper * mapper)
inline

Definition at line 76 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 103 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 96 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 148 of file qqmljsimporter_p.h.


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