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
QQmlTypeLoader::Blob Class Reference

#include <qqmltypeloader_p.h>

+ Inheritance diagram for QQmlTypeLoader::Blob:
+ Collaboration diagram for QQmlTypeLoader::Blob:

Classes

struct  PendingImport
 

Public Types

using PendingImportPtr = std::shared_ptr<PendingImport>
 
- Public Types inherited from QQmlDataBlob
enum  Status {
  Null , Loading , WaitingForDependencies , ResolvingDependencies ,
  Complete , Error
}
 This enum describes the status of the data blob. More...
 
enum  Type { QmlFile = QQmlAbstractUrlInterceptor::QmlFile , JavaScriptFile = QQmlAbstractUrlInterceptor::JavaScriptFile , QmldirFile = QQmlAbstractUrlInterceptor::QmldirFile }
 This enum describes the type of the data blob. More...
 
using Ptr = QQmlRefPointer<QQmlDataBlob>
 

Public Member Functions

 Blob (const QUrl &url, QQmlDataBlob::Type type, QQmlTypeLoader *loader)
 
 ~Blob () override
 
const QQmlImportsimports () const
 
void setCachedUnitStatus (QQmlMetaType::CachedUnitLookupError status)
 
void importQmldirScripts (const PendingImportPtr &import, const QQmlTypeLoaderQmldirContent &qmldir, const QUrl &qmldirUrl)
 
- Public Member Functions inherited from QQmlDataBlob
 QQmlDataBlob (const QUrl &, Type, QQmlTypeLoader *manager)
 Create a new QQmlDataBlob for url and of the provided type.
 
virtual ~QQmlDataBlob ()
 
void startLoading ()
 Must be called before loading can occur.
 
QQmlTypeLoadertypeLoader () const
 
Type type () const
 Returns the type provided to the constructor.
 
Status status () const
 Returns the blob's status.
 
bool isNull () const
 Returns true if the status is Null.
 
bool isLoading () const
 Returns true if the status is Loading.
 
bool isWaiting () const
 Returns true if the status is WaitingForDependencies.
 
bool isComplete () const
 Returns true if the status is Complete.
 
bool isError () const
 Returns true if the status is Error.
 
bool isCompleteOrError () const
 Returns true if the status is Complete or Error.
 
qreal progress () const
 Returns the data download progress from 0 to 1.
 
QUrl url () const
 Returns the physical url of the data.
 
QString urlString () const
 
QUrl finalUrl () const
 Returns the logical URL to be used for resolving further URLs referred to in the code.
 
QString finalUrlString () const
 Returns the finalUrl() as a string.
 
QList< QQmlErrorerrors () const
 Return the errors on this blob.
 
- Public Member Functions inherited from QQmlRefCounted< QQmlDataBlob >
void release () const
 
- Public Member Functions inherited from QQmlRefCount
 QQmlRefCount ()
 
void addref () const
 
int count () const
 

Protected Member Functions

bool addImport (const QV4::CompiledData::Import *import, QQmlImports::ImportFlags, QList< QQmlError > *errors)
 
bool addImport (PendingImportPtr import, QList< QQmlError > *errors)
 
bool fetchQmldir (const QUrl &url, PendingImportPtr import, int priority, QList< QQmlError > *errors)
 
bool updateQmldir (const QQmlRefPointer< QQmlQmldirData > &data, const PendingImportPtr &import, QList< QQmlError > *errors)
 
bool loadDependentImports (const QList< QQmlDirParser::Import > &imports, const QString &qualifier, QTypeRevision version, quint16 precedence, QQmlImports::ImportFlags flags, QList< QQmlError > *errors)
 
virtual QString stringAt (int) const
 
bool isDebugging () const
 
bool readCacheFile () const
 
bool writeCacheFile () const
 
QQmlMetaType::CacheMode aotCacheMode () const
 
- Protected Member Functions inherited from QQmlDataBlob
void setError (const QQmlError &)
 Mark this blob as having errors.
 
void setError (const QList< QQmlError > &errors)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void setError (const QQmlJS::DiagnosticMessage &error)
 
void setError (const QString &description)
 
void addDependency (QQmlDataBlob *)
 Wait for blob to become complete or to error.
 
virtual void dataReceived (const SourceCodeData &)=0
 Invoked when data for the blob is received.
 
virtual void initializeFromCachedUnit (const QQmlPrivate::CachedQmlUnit *)=0
 
virtual void done ()
 Invoked once data has either been received or a network error occurred, and all dependencies are complete.
 
virtual void dependencyError (QQmlDataBlob *)
 Called if blob, which was previously waited for, has an error.
 
virtual void allDependenciesDone ()
 Called when all blobs waited for have completed.
 
virtual void downloadProgressChanged (qreal)
 Called when the download progress of this blob changes.
 
virtual void completed ()
 Invoked on the main thread sometime after done() was called on the load thread.
 
- Protected Member Functions inherited from QQmlRefCounted< QQmlDataBlob >
 ~QQmlRefCounted ()
 

Protected Attributes

QQmlRefPointer< QQmlImportsm_importCache
 
QVector< PendingImportPtrm_unresolvedImports
 
QVector< QQmlRefPointer< QQmlQmldirData > > m_qmldirs
 
QQmlMetaType::CachedUnitLookupError m_cachedUnitStatus = QQmlMetaType::CachedUnitLookupError::NoError
 
- Protected Attributes inherited from QQmlDataBlob
QQmlTypeLoaderm_typeLoader
 
QList< QQmlDataBlob * > m_waitingOnMe
 

Private Member Functions

virtual bool qmldirDataAvailable (const QQmlRefPointer< QQmlQmldirData > &, QList< QQmlError > *)
 
virtual void scriptImported (const QQmlRefPointer< QQmlScriptBlob > &, const QV4::CompiledData::Location &, const QString &, const QString &)
 
void dependencyComplete (QQmlDataBlob *) override
 Called if blob, which was previously waited for, has completed.
 

Detailed Description

Definition at line 49 of file qqmltypeloader_p.h.

Member Typedef Documentation

◆ PendingImportPtr

Definition at line 78 of file qqmltypeloader_p.h.

Constructor & Destructor Documentation

◆ Blob()

QQmlTypeLoader::Blob::Blob ( const QUrl & url,
QQmlDataBlob::Type type,
QQmlTypeLoader * loader )

Definition at line 456 of file qqmltypeloader.cpp.

◆ ~Blob()

QQmlTypeLoader::Blob::~Blob ( )
override

Definition at line 462 of file qqmltypeloader.cpp.

Member Function Documentation

◆ addImport() [1/2]

bool QQmlTypeLoader::Blob::addImport ( const QV4::CompiledData::Import * import,
QQmlImports::ImportFlags flags,
QList< QQmlError > * errors )
protected

Definition at line 746 of file qqmltypeloader.cpp.

◆ addImport() [2/2]

◆ aotCacheMode()

QQmlMetaType::CacheMode QQmlTypeLoader::Blob::aotCacheMode ( ) const
protected

Definition at line 886 of file qqmltypeloader.cpp.

References QQmlMetaType::AcceptUntyped, QV4::ExecutionEngine::Aot, QV4::ExecutionEngine::AotByteCode, QQmlMetaType::RejectAll, and QQmlMetaType::RequireFullyTyped.

Referenced by QQmlTypeLoader::getType().

+ Here is the caller graph for this function:

◆ dependencyComplete()

void QQmlTypeLoader::Blob::dependencyComplete ( QQmlDataBlob * blob)
overrideprivatevirtual

Called if blob, which was previously waited for, has completed.

The default implementation does nothing.

Reimplemented from QQmlDataBlob.

Definition at line 772 of file qqmltypeloader.cpp.

References QV4::CompiledData::Location::column(), error, QV4::CompiledData::Location::line(), Q_ASSERT, QQmlDataBlob::QmldirFile, setError(), and QQmlDataBlob::type().

+ Here is the call graph for this function:

◆ fetchQmldir()

bool QQmlTypeLoader::Blob::fetchQmldir ( const QUrl & url,
PendingImportPtr import,
int priority,
QList< QQmlError > * errors )
protected

Definition at line 466 of file qqmltypeloader.cpp.

References Complete, Error, and url.

◆ importQmldirScripts()

void QQmlTypeLoader::Blob::importQmldirScripts ( const PendingImportPtr & import,
const QQmlTypeLoaderQmldirContent & qmldir,
const QUrl & qmldirUrl )

Import any qualified scripts of for import as listed in qmldir. Precondition is that import is actually qualified.

Definition at line 490 of file qqmltypeloader.cpp.

References QUrl::resolved(), and QQmlTypeLoaderQmldirContent::scripts().

+ Here is the call graph for this function:

◆ imports()

const QQmlImports * QQmlTypeLoader::Blob::imports ( ) const
inline

Definition at line 55 of file qqmltypeloader_p.h.

Referenced by QQmlTypeCompiler::imports().

+ Here is the caller graph for this function:

◆ isDebugging()

bool QQmlTypeLoader::Blob::isDebugging ( ) const
protected

Definition at line 869 of file qqmltypeloader.cpp.

Referenced by QQmlScriptBlob::dataReceived(), and QQmlTypeData::initializeFromCachedUnit().

+ Here is the caller graph for this function:

◆ loadDependentImports()

bool QQmlTypeLoader::Blob::loadDependentImports ( const QList< QQmlDirParser::Import > & imports,
const QString & qualifier,
QTypeRevision version,
quint16 precedence,
QQmlImports::ImportFlags flags,
QList< QQmlError > * errors )
protected

Definition at line 790 of file qqmltypeloader.cpp.

References arg, QQmlDirParser::Import::Auto, error, QString::fromLatin1(), lcQmlImport(), QQmlDirParser::Import::Optional, and qCDebug.

+ Here is the call graph for this function:

◆ qmldirDataAvailable()

bool QQmlTypeLoader::Blob::qmldirDataAvailable ( const QQmlRefPointer< QQmlQmldirData > & data,
QList< QQmlError > * errors )
privatevirtual

Definition at line 897 of file qqmltypeloader.cpp.

◆ readCacheFile()

bool QQmlTypeLoader::Blob::readCacheFile ( ) const
protected

Definition at line 874 of file qqmltypeloader.cpp.

References QV4::ExecutionEngine::QmlcRead.

Referenced by QQmlScriptBlob::dataReceived().

+ Here is the caller graph for this function:

◆ scriptImported()

virtual void QQmlTypeLoader::Blob::scriptImported ( const QQmlRefPointer< QQmlScriptBlob > & ,
const QV4::CompiledData::Location & ,
const QString & ,
const QString &  )
inlineprivatevirtual

Reimplemented in QQmlTypeData, and QQmlScriptBlob.

Definition at line 97 of file qqmltypeloader_p.h.

◆ setCachedUnitStatus()

void QQmlTypeLoader::Blob::setCachedUnitStatus ( QQmlMetaType::CachedUnitLookupError status)
inline

Definition at line 57 of file qqmltypeloader_p.h.

Referenced by QQmlTypeLoader::getType().

+ Here is the caller graph for this function:

◆ stringAt()

virtual QString QQmlTypeLoader::Blob::stringAt ( int ) const
inlineprotectedvirtual

Reimplemented in QQmlScriptBlob, and QQmlTypeData.

Definition at line 110 of file qqmltypeloader_p.h.

◆ updateQmldir()

bool QQmlTypeLoader::Blob::updateQmldir ( const QQmlRefPointer< QQmlQmldirData > & data,
const PendingImportPtr & import,
QList< QQmlError > * errors )
protected

Definition at line 525 of file qqmltypeloader.cpp.

References QTypeRevision::hasMajorVersion(), QTypeRevision::isValid(), QString::left(), and postProcessQmldir().

+ Here is the call graph for this function:

◆ writeCacheFile()

bool QQmlTypeLoader::Blob::writeCacheFile ( ) const
protected

Definition at line 880 of file qqmltypeloader.cpp.

References QV4::ExecutionEngine::QmlcWrite.

Referenced by QQmlScriptBlob::dataReceived().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_cachedUnitStatus

QQmlMetaType::CachedUnitLookupError QQmlTypeLoader::Blob::m_cachedUnitStatus = QQmlMetaType::CachedUnitLookupError::NoError
protected

Definition at line 120 of file qqmltypeloader_p.h.

Referenced by QQmlScriptBlob::dataReceived(), and QQmlTypeData::dataReceived().

◆ m_importCache

QQmlRefPointer<QQmlImports> QQmlTypeLoader::Blob::m_importCache
protected

◆ m_qmldirs

QVector<QQmlRefPointer<QQmlQmldirData> > QQmlTypeLoader::Blob::m_qmldirs
protected

Definition at line 119 of file qqmltypeloader_p.h.

◆ m_unresolvedImports

QVector<PendingImportPtr> QQmlTypeLoader::Blob::m_unresolvedImports
protected

Definition at line 118 of file qqmltypeloader_p.h.

Referenced by QQmlTypeData::allDependenciesDone().


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