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

#include <qqmlimport_p.h>

+ Collaboration diagram for QQmlImportInstance:

Public Types

enum  Precedence { Lowest = std::numeric_limits<quint8>::max() , Implicit = Lowest / 2 , Highest = 0 }
 

Public Member Functions

bool setQmldirContent (const QString &resolvedUrl, const QQmlTypeLoaderQmldirContent &qmldir, QQmlImportNamespace *nameSpace, QList< QQmlError > *errors)
 
bool resolveType (QQmlTypeLoader *typeLoader, const QHashedStringRef &type, QTypeRevision *version_return, QQmlType *type_return, const QString *base=nullptr, bool *typeRecursionDetected=nullptr, QQmlType::RegistrationType=QQmlType::AnyRegistrationType, QQmlImport::RecursionRestriction recursionRestriction=QQmlImport::PreventRecursion, QList< QQmlError > *errors=nullptr) const
 

Static Public Member Functions

static QQmlDirScripts getVersionedScripts (const QQmlDirScripts &qmldirscripts, QTypeRevision version)
 

Public Attributes

QString uri
 
QString url
 
QTypeRevision version
 
bool isLibrary
 
bool implicitlyImported = false
 
bool isInlineComponent = false
 
quint8 precedence = 0
 
QQmlDirComponents qmlDirComponents
 
QQmlDirScripts qmlDirScripts
 

Detailed Description

A QQmlImportType represents a single import of a document, held within a namespace.

Note
The uri here may not necessarily be unique (e.g. for file imports).
Version numbers may be -1 for file imports: this means that no version was specified as part of the import. Type resolution will be responsible for attempting to find the "best" possible version.

Definition at line 49 of file qqmlimport_p.h.

Member Enumeration Documentation

◆ Precedence

Enumerator
Lowest 
Implicit 
Highest 

Definition at line 51 of file qqmlimport_p.h.

Member Function Documentation

◆ getVersionedScripts()

QQmlDirScripts QQmlImportInstance::getVersionedScripts ( const QQmlDirScripts qmldirscripts,
QTypeRevision  version 
)
static

Definition at line 528 of file qqmlimport.cpp.

References QList< T >::constBegin(), QList< T >::constEnd(), QMap< Key, T >::end(), QMap< Key, T >::find(), QTypeRevision::hasMajorVersion(), QTypeRevision::hasMinorVersion(), QMap< Key, T >::insert(), QTypeRevision::majorVersion(), QTypeRevision::minorVersion(), QMap< Key, T >::values(), and version.

Referenced by setQmldirContent().

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

◆ resolveType()

bool QQmlImportInstance::resolveType ( QQmlTypeLoader typeLoader,
const QHashedStringRef type,
QTypeRevision version_return,
QQmlType type_return,
const QString base = nullptr,
bool *  typeRecursionDetected = nullptr,
QQmlType::RegistrationType  registrationType = QQmlType::AnyRegistrationType,
QQmlImport::RecursionRestriction  recursionRestriction = QQmlImport::PreventRecursion,
QList< QQmlError > *  errors = nullptr 
) const

◆ setQmldirContent()

bool QQmlImportInstance::setQmldirContent ( const QString resolvedUrl,
const QQmlTypeLoaderQmldirContent qmldir,
QQmlImportNamespace nameSpace,
QList< QQmlError > *  errors 
)

Definition at line 488 of file qqmlimport.cpp.

References QQmlTypeLoaderQmldirContent::components(), QList< T >::constBegin(), QList< T >::constEnd(), QString::endsWith(), error, QUrl::fromLocalFile(), getVersionedScripts(), QQmlImportNamespace::imports, QString::isEmpty(), QList< T >::isEmpty(), it, QQmlTypeLoaderQmldirContent::preferredPath(), QList< T >::prepend(), Q_ASSERT, qmlDirComponents, qmlDirScripts, QStringLiteral, resolvedUrl(), QQmlTypeLoaderQmldirContent::scripts(), Slash, QString::startsWith(), QUrl::toString(), uri, url, and version.

Referenced by QQmlImports::addFileImport(), and QQmlImports::addLibraryImport().

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

Member Data Documentation

◆ implicitlyImported

bool QQmlImportInstance::implicitlyImported = false

Definition at line 64 of file qqmlimport_p.h.

Referenced by resolveType().

◆ isInlineComponent

bool QQmlImportInstance::isInlineComponent = false

Definition at line 65 of file qqmlimport_p.h.

Referenced by QQmlImports::addInlineComponentImport(), and resolveType().

◆ isLibrary

bool QQmlImportInstance::isLibrary

Definition at line 61 of file qqmlimport_p.h.

Referenced by resolveType().

◆ precedence

quint8 QQmlImportInstance::precedence = 0

Definition at line 67 of file qqmlimport_p.h.

◆ qmlDirComponents

QQmlDirComponents QQmlImportInstance::qmlDirComponents

Definition at line 69 of file qqmlimport_p.h.

Referenced by QQmlImports::addLibraryImport(), resolveType(), and setQmldirContent().

◆ qmlDirScripts

QQmlDirScripts QQmlImportInstance::qmlDirScripts

Definition at line 70 of file qqmlimport_p.h.

Referenced by QQmlImports::addLibraryImport(), and setQmldirContent().

◆ uri

QString QQmlImportInstance::uri

◆ url

◆ version


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