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
qqmlimport.cpp File Reference

(19b09affee8698f80d386e3b286753974f6bf10a)

#include "qqmlimport_p.h"
#include <QtCore/qdebug.h>
#include <QtCore/qdir.h>
#include <QtQml/qqmlfile.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qpluginloader.h>
#include <QtCore/qlibraryinfo.h>
#include <QtCore/qloggingcategory.h>
#include <QtQml/qqmlextensioninterface.h>
#include <QtQml/qqmlextensionplugin.h>
#include <private/qqmlextensionplugin_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qqmltypenamecache_p.h>
#include <private/qqmlengine_p.h>
#include <private/qqmltypemodule_p.h>
#include <private/qqmltypeloaderqmldircontent_p.h>
#include <private/qqmlpluginimporter_p.h>
#include <QtCore/qjsonobject.h>
#include <QtCore/qjsonarray.h>
#include <QtQml/private/qqmltype_p_p.h>
#include <QtQml/private/qqmlimportresolver_p.h>
#include <algorithm>
#include <functional>
+ Include dependency graph for qqmlimport.cpp:

Go to the source code of this file.

Classes

class  QmlImportCategoryHolder
 

Macros

#define RESOLVE_TYPE_DEBUG
 

Functions

const QLoggingCategorylcQmlImport ()
 
bool excludeBaseUrl (const QString &importUrl, const QString &fileName, const QString &baseUrl)
 
void findCompositeSingletons (const QQmlImportNamespace &set, QList< QQmlImports::CompositeSingletonReference > &resultList, const QUrl &baseUrl)
 
static QQmlImportInstanceaddImportToNamespace (QQmlImportNamespace *nameSpace, const QString &uri, const QString &url, QTypeRevision version, QV4::CompiledData::Import::ImportType type, QList< QQmlError > *errors, quint16 precedence)
 
static QStringList parseEnvPath (const QString &envImportPath)
 

Variables

static const QLatin1Char Dot ('.')
 
static const QLatin1Char Slash ('/')
 
static const QLatin1Char Backslash ('\\')
 
static const QLatin1Char Colon (':')
 
static const QLatin1String Slash_qmldir ("/qmldir")
 
static const QLatin1String String_qmldir ("qmldir")
 
static const QString dotqml_string (QStringLiteral(".qml"))
 
static const QString dotuidotqml_string (QStringLiteral(".ui.qml"))
 
static bool designerSupportRequired = false
 

Macro Definition Documentation

◆ RESOLVE_TYPE_DEBUG

#define RESOLVE_TYPE_DEBUG
Value:
<< "resolveType:" << qPrintable(baseUrl().toString()) << type.toString() << " => "
#define qCDebug(category,...)
GLenum type
const QLoggingCategory & lcQmlImport()
#define qPrintable(string)
Definition qstring.h:1531
QUrl baseUrl
char * toString(const MyType &t)
[31]

Function Documentation

◆ addImportToNamespace()

static QQmlImportInstance * addImportToNamespace ( QQmlImportNamespace * nameSpace,
const QString & uri,
const QString & url,
QTypeRevision version,
QV4::CompiledData::Import::ImportType type,
QList< QQmlError > * errors,
quint16 precedence )
static

Definition at line 1119 of file qqmlimport.cpp.

References QList< T >::append(), QList< T >::cbegin(), QList< T >::cend(), QQmlImportInstance::Implicit, QV4::CompiledData::Import::ImportLibrary, QQmlImportNamespace::imports, QList< T >::insert(), QUrl::isEmpty(), it, Q_ASSERT, Q_UNUSED, Slash, QQmlImportInstance::uri, and url.

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

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

◆ excludeBaseUrl()

bool excludeBaseUrl ( const QString & importUrl,
const QString & fileName,
const QString & baseUrl )

Definition at line 270 of file qqmlimport.cpp.

References baseUrl, and fileName.

Referenced by findCompositeSingletons().

+ Here is the caller graph for this function:

◆ findCompositeSingletons()

void findCompositeSingletons ( const QQmlImportNamespace & set,
QList< QQmlImports::CompositeSingletonReference > & resultList,
const QUrl & baseUrl )

Definition at line 284 of file qqmlimport.cpp.

References baseUrl, QMultiHash< QString, QQmlDirParser::Component >::const_iterator, excludeBaseUrl(), QTypeRevision::hasMajorVersion(), set, QUrl::toString(), QQmlMetaType::typeModule(), and QQmlImports::CompositeSingletonReference::typeName.

Referenced by QQmlImports::resolvedCompositeSingletons().

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

◆ lcQmlImport()

const QLoggingCategory & lcQmlImport ( )

Definition at line 63 of file qqmlimport.cpp.

References QmlImportCategoryHolder::category().

Referenced by QQmlImports::addFileImport(), QQmlImports::addImplicitImport(), QQmlImportDatabase::addImportPath(), QQmlImports::addLibraryImport(), QQmlImportDatabase::addPluginPath(), QQmlPluginImporter::importPlugins(), QQmlTypeLoader::Blob::loadDependentImports(), QQmlImportDatabase::locateLocalQmldir(), QQmlImports::resolveType(), QQmlImportDatabase::setImportPathList(), QQmlImportDatabase::setPluginPathList(), and QQmlImports::updateQmldirContent().

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

◆ parseEnvPath()

static QStringList parseEnvPath ( const QString & envImportPath)
static

Definition at line 1477 of file qqmlimport.cpp.

References QSet< T >::begin(), QSet< T >::end(), QSet< T >::erase(), QSet< T >::isEmpty(), it, QDir::listSeparator(), and Qt::SkipEmptyParts.

Referenced by QQmlImportDatabase::QQmlImportDatabase().

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

Variable Documentation

◆ Backslash

◆ Colon

const QLatin1Char Colon(':') ( ':' )
static

◆ designerSupportRequired

bool designerSupportRequired = false
static

Definition at line 79 of file qqmlimport.cpp.

Referenced by QQmlImports::setDesignerSupportRequired().

◆ Dot

const QLatin1Char Dot('.') ( '.' )
static

◆ dotqml_string

const QString dotqml_string(QStringLiteral(".qml")) ( QStringLiteral(".qml") )
static

◆ dotuidotqml_string

const QString dotuidotqml_string(QStringLiteral(".ui.qml")) ( QStringLiteral(".ui.qml") )
static

◆ Slash

◆ Slash_qmldir

const QLatin1String Slash_qmldir("/qmldir") ( "/qmldir" )
static

◆ String_qmldir

const QLatin1String String_qmldir("qmldir") ( "qmldir" )
static