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

#include <qqmlimport_p.h>

+ Collaboration diagram for QQmlImportNamespace:

Public Member Functions

 QQmlImportNamespace ()
 
 ~QQmlImportNamespace ()
 
QQmlImportInstancefindImport (const QString &uri) const
 
bool resolveType (QQmlTypeLoader *typeLoader, const QHashedStringRef &type, QTypeRevision *version_return, QQmlType *type_return, const QString *base=nullptr, QList< QQmlError > *errors=nullptr, QQmlType::RegistrationType registrationType=QQmlType::AnyRegistrationType, bool *typeRecursionDeteced=nullptr)
 
bool needsSorting () const
 
void setNeedsSorting (bool needsSorting)
 

Public Attributes

QList< QQmlImportInstance * > imports
 
QHashedString prefix
 
QQmlImportNamespacenextNamespace = nullptr
 

Detailed Description

A QQmlImportNamespace is a way of seperating imports into a local namespace.

Within a QML document, there is at least one namespace (the "unqualified set") where imports without a qualifier are placed, i.e:

import QtQuick 2.6

will have a single namespace (the unqualified set) containing a single import for QtQuick 2.6. However, there may be others if an import statement gives a qualifier, i.e the following will result in an additional new QQmlImportNamespace in the qualified set:

import MyFoo 1.0 as Foo

Definition at line 86 of file qqmlimport_p.h.

Constructor & Destructor Documentation

◆ QQmlImportNamespace()

QQmlImportNamespace::QQmlImportNamespace ( )
inline

Definition at line 89 of file qqmlimport_p.h.

◆ ~QQmlImportNamespace()

QQmlImportNamespace::~QQmlImportNamespace ( )
inline

Definition at line 90 of file qqmlimport_p.h.

References imports, and qDeleteAll().

+ Here is the call graph for this function:

Member Function Documentation

◆ findImport()

QQmlImportInstance * QQmlImportNamespace::findImport ( const QString uri) const

Definition at line 795 of file qqmlimport.cpp.

References imports.

Referenced by QQmlImports::updateQmldirContent().

+ Here is the caller graph for this function:

◆ needsSorting()

bool QQmlImportNamespace::needsSorting ( ) const
inline

Definition at line 110 of file qqmlimport_p.h.

References nextNamespace.

Referenced by resolveType(), and setNeedsSorting().

+ Here is the caller graph for this function:

◆ resolveType()

bool QQmlImportNamespace::resolveType ( QQmlTypeLoader typeLoader,
const QHashedStringRef type,
QTypeRevision version_return,
QQmlType type_return,
const QString base = nullptr,
QList< QQmlError > *  errors = nullptr,
QQmlType::RegistrationType  registrationType = QQmlType::AnyRegistrationType,
bool *  typeRecursionDeteced = nullptr 
)

◆ setNeedsSorting()

void QQmlImportNamespace::setNeedsSorting ( bool  needsSorting)
inline

Definition at line 111 of file qqmlimport_p.h.

References needsSorting(), nextNamespace, Q_ASSERT, and this.

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

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

Member Data Documentation

◆ imports

◆ nextNamespace

QQmlImportNamespace* QQmlImportNamespace::nextNamespace = nullptr

Definition at line 109 of file qqmlimport_p.h.

Referenced by needsSorting(), and setNeedsSorting().

◆ prefix

QHashedString QQmlImportNamespace::prefix

Definition at line 103 of file qqmlimport_p.h.

Referenced by QQmlImports::addFileImport().


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