Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QQmlTypeCompiler Struct Reference

#include <qqmltypecompiler_p.h>

+ Collaboration diagram for QQmlTypeCompiler:

Public Types

typedef QmlIR::Object CompiledObject
 
typedef QmlIR::Binding CompiledBinding
 
using ListPropertyAssignBehavior = QmlIR::Pragma::ListPropertyAssignBehaviorValue
 
using IdToObjectMap = QMap< int, int >
 

Public Member Functions

 QQmlTypeCompiler (QQmlEnginePrivate *engine, QQmlTypeData *typeData, QmlIR::Document *document, const QQmlRefPointer< QQmlTypeNameCache > &typeNameCache, QV4::ResolvedTypeReferenceMap *resolvedTypeCache, const QV4::CompiledData::DependentTypesHasher &dependencyHasher)
 
const QmlIR::ObjectobjectAt (int index) const
 
QmlIR::ObjectobjectAt (int index)
 
int objectCount () const
 
QString stringAt (int idx) const
 
QmlIR::PoolList< QmlIR::Function >::Iterator objectFunctionsBegin (const QmlIR::Object *object) const
 
QmlIR::PoolList< QmlIR::Function >::Iterator objectFunctionsEnd (const QmlIR::Object *object) const
 
ListPropertyAssignBehavior listPropertyAssignBehavior () const
 
QQmlRefPointer< QV4::ExecutableCompilationUnitcompile ()
 
QList< QQmlErrorcompilationErrors () const
 
void recordError (const QV4::CompiledData::Location &location, const QString &description)
 
void recordError (const QQmlJS::DiagnosticMessage &message)
 
void recordError (const QQmlError &e)
 
int registerString (const QString &str)
 
int registerConstant (QV4::ReturnedValue v)
 
const QV4::CompiledData::UnitqmlUnit () const
 
QUrl url () const
 
QQmlEnginePrivateenginePrivate () const
 
const QQmlImportsimports () const
 
QVector< QmlIR::Object * > * qmlObjects () const
 
QQmlPropertyCacheVectorpropertyCaches ()
 
const QQmlPropertyCacheVectorpropertyCaches () const
 
QQmlJS::MemoryPoolmemoryPool ()
 
QStringView newStringRef (const QString &string)
 
const QV4::Compiler::StringTableGeneratorstringPool () const
 
const QHash< int, QQmlCustomParser * > & customParserCache () const
 
QString bindingAsString (const QmlIR::Object *object, int scriptIndex) const
 
void addImport (const QString &module, const QString &qualifier, QTypeRevision version)
 
QV4::ResolvedTypeReferenceresolvedType (int id) const
 
QQmlType qmlTypeForComponent (const QString &inlineComponentName=QString()) const
 

Public Attributes

QV4::ResolvedTypeReferenceMapresolvedTypes = nullptr
 

Detailed Description

Definition at line 42 of file qqmltypecompiler_p.h.

Member Typedef Documentation

◆ CompiledBinding

◆ CompiledObject

◆ IdToObjectMap

Definition at line 59 of file qqmltypecompiler_p.h.

◆ ListPropertyAssignBehavior

Constructor & Destructor Documentation

◆ QQmlTypeCompiler()

QQmlTypeCompiler::QQmlTypeCompiler ( QQmlEnginePrivate engine,
QQmlTypeData typeData,
QmlIR::Document document,
const QQmlRefPointer< QQmlTypeNameCache > &  typeNameCache,
QV4::ResolvedTypeReferenceMap resolvedTypeCache,
const QV4::CompiledData::DependentTypesHasher dependencyHasher 
)

Definition at line 26 of file qqmltypecompiler.cpp.

Member Function Documentation

◆ addImport()

void QQmlTypeCompiler::addImport ( const QString module,
const QString qualifier,
QTypeRevision  version 
)

Definition at line 241 of file qqmltypecompiler.cpp.

References QList< T >::append(), QList< T >::at(), i, QV4::CompiledData::Import::ImportLibrary, QmlIR::Document::imports, memoryPool(), pool, QV4::CompiledData::Import::qualifierIndex, registerString(), QList< T >::size(), QV4::CompiledData::Import::type, and QV4::CompiledData::Import::uriIndex.

+ Here is the call graph for this function:

◆ bindingAsString()

QString QQmlTypeCompiler::bindingAsString ( const QmlIR::Object object,
int  scriptIndex 
) const

Definition at line 236 of file qqmltypecompiler.cpp.

Referenced by QQmlScriptStringScanner::scan().

+ Here is the caller graph for this function:

◆ compilationErrors()

QList< QQmlError > QQmlTypeCompiler::compilationErrors ( ) const
inline

Definition at line 80 of file qqmltypecompiler_p.h.

◆ compile()

QQmlRefPointer< QV4::ExecutableCompilationUnit > QQmlTypeCompiler::compile ( )

Definition at line 38 of file qqmltypecompiler.cpp.

References QQmlAliasAnnotator::annotateBindingsToAliases(), QQmlCustomParserScriptIndexer::annotateBindingsWithScriptStrings(), QQmlPropertyCacheCreator< ObjectContainer >::buildMetaObjectsIncrementally(), QList< T >::clear(), QHash< Key, T >::constBegin(), QHash< Key, T >::constEnd(), QV4::ExecutableCompilationUnit::create(), enginePrivate(), error, QV4::Compiler::Codegen::error(), QV4::Compiler::Module::fileName, QV4::Compiler::Module::finalUrl, QQmlDataBlob::finalUrlString(), QmlIR::QmlUnitGenerator::generate(), QV4::Compiler::Codegen::generateCompilationUnit(), QmlIR::JSCodeGen::generateRuntimeFunctions(), QV4::Compiler::Codegen::hasError(), QV4::ExecutionEngine::illegalNames(), imports(), QHash< Key, T >::insert(), QList< T >::isEmpty(), QQmlError::isValid(), it, QmlIR::Document::javaScriptCompilationUnit, QmlIR::Document::jsModule, QQmlDefaultPropertyMerger::mergeDefaultProperties(), QmlIR::Document::objects, Q_ASSERT, recordError(), QQmlComponentAndAliasResolver< ObjectContainer >::resolve(), resolvedTypes, QQmlEnumTypeResolver::resolveEnumBindings(), QQmlPendingGroupPropertyBindings::resolveMissingPropertyCaches(), SignalHandlerResolver::resolveSignalHandlerExpressions(), QQmlScriptStringScanner::scan(), QQmlDeferredAndCustomParserBindingScanner::scanObject(), QQmlTypeData::typeClassName(), QV4::CompiledData::CompilationUnit::unitData(), QQmlDataBlob::urlString(), QQmlEnginePrivate::v4engine(), and QQmlPropertyCacheCreator< ObjectContainer >::verifyNoICCycle().

+ Here is the call graph for this function:

◆ customParserCache()

const QHash< int, QQmlCustomParser * > & QQmlTypeCompiler::customParserCache ( ) const
inline

Definition at line 100 of file qqmltypecompiler_p.h.

◆ enginePrivate()

QQmlEnginePrivate * QQmlTypeCompiler::enginePrivate ( ) const
inline

Definition at line 91 of file qqmltypecompiler_p.h.

References engine.

Referenced by compile().

+ Here is the caller graph for this function:

◆ imports()

const QQmlImports * QQmlTypeCompiler::imports ( ) const

Definition at line 201 of file qqmltypecompiler.cpp.

References QQmlTypeLoader::Blob::imports().

Referenced by compile().

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

◆ listPropertyAssignBehavior()

ListPropertyAssignBehavior QQmlTypeCompiler::listPropertyAssignBehavior ( ) const
inline

Definition at line 68 of file qqmltypecompiler_p.h.

References QmlIR::Pragma::ListPropertyAssignBehavior.

◆ memoryPool()

QQmlJS::MemoryPool * QQmlTypeCompiler::memoryPool ( )

Definition at line 221 of file qqmltypecompiler.cpp.

References QmlIR::Document::jsParserEngine, and QQmlJS::Engine::pool().

Referenced by addImport().

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

◆ newStringRef()

QStringView QQmlTypeCompiler::newStringRef ( const QString string)

Definition at line 226 of file qqmltypecompiler.cpp.

References QmlIR::Document::jsParserEngine, and QQmlJS::Engine::newStringRef().

+ Here is the call graph for this function:

◆ objectAt() [1/2]

QmlIR::Object * QQmlTypeCompiler::objectAt ( int  index)
inline

Definition at line 62 of file qqmltypecompiler_p.h.

◆ objectAt() [2/2]

const QmlIR::Object * QQmlTypeCompiler::objectAt ( int  index) const
inline

Definition at line 61 of file qqmltypecompiler_p.h.

◆ objectCount()

int QQmlTypeCompiler::objectCount ( ) const
inline

Definition at line 63 of file qqmltypecompiler_p.h.

◆ objectFunctionsBegin()

QmlIR::PoolList< QmlIR::Function >::Iterator QQmlTypeCompiler::objectFunctionsBegin ( const QmlIR::Object object) const
inline

Definition at line 65 of file qqmltypecompiler_p.h.

◆ objectFunctionsEnd()

QmlIR::PoolList< QmlIR::Function >::Iterator QQmlTypeCompiler::objectFunctionsEnd ( const QmlIR::Object object) const
inline

Definition at line 66 of file qqmltypecompiler_p.h.

◆ propertyCaches() [1/2]

QQmlPropertyCacheVector * QQmlTypeCompiler::propertyCaches ( )

Definition at line 211 of file qqmltypecompiler.cpp.

◆ propertyCaches() [2/2]

const QQmlPropertyCacheVector * QQmlTypeCompiler::propertyCaches ( ) const

Definition at line 216 of file qqmltypecompiler.cpp.

◆ qmlObjects()

QVector< QmlIR::Object * > * QQmlTypeCompiler::qmlObjects ( ) const

Definition at line 206 of file qqmltypecompiler.cpp.

References QmlIR::Document::objects.

◆ qmlTypeForComponent()

QQmlType QQmlTypeCompiler::qmlTypeForComponent ( const QString inlineComponentName = QString()) const

Definition at line 262 of file qqmltypecompiler.cpp.

References QQmlTypeData::qmlType().

+ Here is the call graph for this function:

◆ qmlUnit()

const QV4::CompiledData::Unit * QQmlTypeCompiler::qmlUnit ( ) const

Definition at line 196 of file qqmltypecompiler.cpp.

References QmlIR::Document::javaScriptCompilationUnit, and QV4::CompiledData::CompilationUnit::unitData().

+ Here is the call graph for this function:

◆ recordError() [1/3]

void QQmlTypeCompiler::recordError ( const QQmlError e)

Definition at line 174 of file qqmltypecompiler.cpp.

References e, error, and url().

+ Here is the call graph for this function:

◆ recordError() [2/3]

void QQmlTypeCompiler::recordError ( const QQmlJS::DiagnosticMessage message)

Definition at line 164 of file qqmltypecompiler.cpp.

References error, qmlConvertSourceCoordinate< quint32, int >(), and url().

+ Here is the call graph for this function:

◆ recordError() [3/3]

void QQmlTypeCompiler::recordError ( const QV4::CompiledData::Location location,
const QString description 
)

Definition at line 154 of file qqmltypecompiler.cpp.

References error, qmlConvertSourceCoordinate< quint32, int >(), and url().

Referenced by compile(), and QQmlCompilePass::recordError().

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

◆ registerConstant()

int QQmlTypeCompiler::registerConstant ( QV4::ReturnedValue  v)

Definition at line 191 of file qqmltypecompiler.cpp.

References QmlIR::Document::jsGenerator, and QV4::Compiler::JSUnitGenerator::registerConstant().

+ Here is the call graph for this function:

◆ registerString()

int QQmlTypeCompiler::registerString ( const QString str)

Definition at line 186 of file qqmltypecompiler.cpp.

References QmlIR::Document::jsGenerator, QV4::Compiler::JSUnitGenerator::registerString(), and str.

Referenced by addImport(), and QQmlScriptStringScanner::scan().

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

◆ resolvedType()

QV4::ResolvedTypeReference * QQmlTypeCompiler::resolvedType ( int  id) const
inline

Definition at line 106 of file qqmltypecompiler_p.h.

References resolvedTypes, and QHash< Key, T >::value().

Referenced by QQmlCompilePass::resolvedType().

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

◆ stringAt()

QString QQmlTypeCompiler::stringAt ( int  idx) const

Definition at line 181 of file qqmltypecompiler.cpp.

References QmlIR::Document::stringAt().

Referenced by QQmlCompilePass::stringAt().

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

◆ stringPool()

const QV4::Compiler::StringTableGenerator * QQmlTypeCompiler::stringPool ( ) const

◆ url()

QUrl QQmlTypeCompiler::url ( ) const
inline

Definition at line 90 of file qqmltypecompiler_p.h.

References QQmlDataBlob::finalUrl().

Referenced by recordError(), recordError(), and recordError().

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

Member Data Documentation

◆ resolvedTypes

QV4::ResolvedTypeReferenceMap* QQmlTypeCompiler::resolvedTypes = nullptr

Definition at line 67 of file qqmltypecompiler_p.h.

Referenced by compile(), and resolvedType().


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