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

Tracks the types for the QmlCompiler. More...

#include <qqmljsscope_p.h>

+ Collaboration diagram for QQmlJSScope:

Classes

struct  AnnotatedScope
 
struct  ContextualTypes
 
class  Export
 
struct  ExportedScope
 
class  Import
 
struct  ImportedScope
 
struct  JavaScriptIdentifier
 
struct  QmlIRCompatibilityBindingData
 

Public Types

enum  Flag {
  Creatable = 0x1 , Composite = 0x2 , Singleton = 0x4 , Script = 0x8 ,
  CustomParser = 0x10 , Array = 0x20 , InlineComponent = 0x40 , WrappedInImplicitComponent = 0x80 ,
  HasBaseTypeError = 0x100 , HasExtensionNamespace = 0x200 , IsListProperty = 0x400 , Structured = 0x800
}
 
enum  BindingTargetSpecifier { SimplePropertyTarget , ListPropertyTarget , UnnamedPropertyTarget }
 
enum  ExtensionKind { NotExtension , ExtensionType , ExtensionNamespace }
 
using Ptr = QDeferredSharedPointer< QQmlJSScope >
 
using WeakPtr = QDeferredWeakPointer< QQmlJSScope >
 
using ConstPtr = QDeferredSharedPointer< const QQmlJSScope >
 
using WeakConstPtr = QDeferredWeakPointer< const QQmlJSScope >
 
using AccessSemantics = QQmlSA::AccessSemantics
 
using ScopeType = QQmlSA::ScopeType
 
using InlineComponentNameType = QString
 
using RootDocumentNameType = std::monostate
 
using InlineComponentOrDocumentRootName = std::variant< InlineComponentNameType, RootDocumentNameType >
 A Hashable type to differentiate document roots from different inline components.
 

Public Member Functions

 QQmlJSScope (const QString &internalName)
 
 QQmlJSScope (QQmlJSScope &&)=default
 
QQmlJSScopeoperator= (QQmlJSScope &&)=default
 
 Q_FLAGS (Flags)
 
QQmlJSScope::Ptr parentScope ()
 
QQmlJSScope::ConstPtr parentScope () const
 
void insertJSIdentifier (const QString &name, const JavaScriptIdentifier &identifier)
 
void insertPropertyIdentifier (const QQmlJSMetaProperty &prop)
 
bool isIdInCurrentScope (const QString &id) const
 
ScopeType scopeType () const
 
void setScopeType (ScopeType type)
 
void addOwnMethod (const QQmlJSMetaMethod &method)
 
QMultiHash< QString, QQmlJSMetaMethodownMethods () const
 
QList< QQmlJSMetaMethodownMethods (const QString &name) const
 
bool hasOwnMethod (const QString &name) const
 
bool hasMethod (const QString &name) const
 
QHash< QString, QQmlJSMetaMethodmethods () const
 Returns all methods visible from this scope including those of base types and extensions.
 
QList< QQmlJSMetaMethodmethods (const QString &name) const
 
QList< QQmlJSMetaMethodmethods (const QString &name, QQmlJSMetaMethodType type) const
 
void addOwnEnumeration (const QQmlJSMetaEnum &enumeration)
 
QHash< QString, QQmlJSMetaEnumownEnumerations () const
 
QQmlJSMetaEnum ownEnumeration (const QString &name) const
 
bool hasOwnEnumeration (const QString &name) const
 
bool hasEnumeration (const QString &name) const
 
bool hasEnumerationKey (const QString &name) const
 
QQmlJSMetaEnum enumeration (const QString &name) const
 
QHash< QString, QQmlJSMetaEnumenumerations () const
 
void setAnnotations (const QList< QQmlJSAnnotation > &annotation)
 
const QList< QQmlJSAnnotation > & annotations () const
 
QString filePath () const
 
void setFilePath (const QString &file)
 
QString internalName () const
 
void setInternalName (const QString &internalName)
 
QString augmentedInternalName () const
 
bool isComponentRootElement () const
 
void setInterfaceNames (const QStringList &interfaces)
 
QStringList interfaceNames () const
 
bool hasInterface (const QString &name) const
 
bool hasOwnInterface (const QString &name) const
 
void setOwnDeferredNames (const QStringList &names)
 
QStringList ownDeferredNames () const
 
void setOwnImmediateNames (const QStringList &names)
 
QStringList ownImmediateNames () const
 
bool isNameDeferred (const QString &name) const
 
void setBaseTypeName (const QString &baseTypeName)
 
QString baseTypeName () const
 
QQmlJSScope::ConstPtr baseType () const
 
QTypeRevision baseTypeRevision () const
 
QString qualifiedName () const
 
void setQualifiedName (const QString &qualifiedName)
 
QString moduleName () const
 
void setModuleName (const QString &moduleName)
 
void clearBaseType ()
 
void setBaseTypeError (const QString &baseTypeError)
 
QString baseTypeError () const
 
void addOwnProperty (const QQmlJSMetaProperty &prop)
 
QHash< QString, QQmlJSMetaPropertyownProperties () const
 
QQmlJSMetaProperty ownProperty (const QString &name) const
 
bool hasOwnProperty (const QString &name) const
 
bool hasProperty (const QString &name) const
 
QQmlJSMetaProperty property (const QString &name) const
 
QHash< QString, QQmlJSMetaPropertyproperties () const
 Returns all properties visible from this scope including those of base types and extensions.
 
void setPropertyLocallyRequired (const QString &name, bool isRequired)
 
bool isPropertyRequired (const QString &name) const
 
bool isPropertyLocallyRequired (const QString &name) const
 
void addOwnPropertyBinding (const QQmlJSMetaPropertyBinding &binding, BindingTargetSpecifier specifier=BindingTargetSpecifier::SimplePropertyTarget)
 
QMultiHash< QString, QQmlJSMetaPropertyBindingownPropertyBindings () const
 
QPair< QMultiHash< QString, QQmlJSMetaPropertyBinding >::const_iterator, QMultiHash< QString, QQmlJSMetaPropertyBinding >::const_iterator > ownPropertyBindings (const QString &name) const
 
QList< QQmlJSMetaPropertyBindingownPropertyBindingsInQmlIROrder () const
 
bool hasOwnPropertyBindings (const QString &name) const
 
bool hasPropertyBindings (const QString &name) const
 
QList< QQmlJSMetaPropertyBindingpropertyBindings (const QString &name) const
 
bool isResolved () const
 
bool isFullyResolved () const
 
QString ownDefaultPropertyName () const
 
void setOwnDefaultPropertyName (const QString &name)
 
QString defaultPropertyName () const
 
QString ownParentPropertyName () const
 
void setOwnParentPropertyName (const QString &name)
 
QString parentPropertyName () const
 
QString ownAttachedTypeName () const
 
void setOwnAttachedTypeName (const QString &name)
 
QQmlJSScope::ConstPtr ownAttachedType () const
 
QString attachedTypeName () const
 
QQmlJSScope::ConstPtr attachedType () const
 
QString extensionTypeName () const
 
void setExtensionTypeName (const QString &name)
 
AnnotatedScope extensionType () const
 
QString valueTypeName () const
 
void setValueTypeName (const QString &name)
 
QQmlJSScope::ConstPtr valueType () const
 
QQmlJSScope::ConstPtr listType () const
 
QQmlJSScope::Ptr listType ()
 
void addOwnRuntimeFunctionIndex (QQmlJSMetaMethod::AbsoluteFunctionIndex index)
 
QQmlJSMetaMethod::AbsoluteFunctionIndex ownRuntimeFunctionIndex (QQmlJSMetaMethod::RelativeFunctionIndex index) const
 
bool isSingleton () const
 
bool isCreatable () const
 
bool hasCreatableFlag () const
 
bool isStructured () const
 
bool hasStructuredFlag () const
 
bool isComposite () const
 
bool isScript () const
 
bool hasCustomParser () const
 
bool isArrayScope () const
 
bool isInlineComponent () const
 
bool isWrappedInImplicitComponent () const
 
bool extensionIsNamespace () const
 
void setIsSingleton (bool v)
 
void setCreatableFlag (bool v)
 
void setStructuredFlag (bool v)
 
void setIsComposite (bool v)
 
void setIsScript (bool v)
 
void setHasCustomParser (bool v)
 
void setIsArrayScope (bool v)
 
void setIsInlineComponent (bool v)
 
void setIsWrappedInImplicitComponent (bool v)
 
void setExtensionIsNamespace (bool v)
 
bool isListProperty () const
 
void setIsListProperty (bool v)
 
void setAccessSemantics (AccessSemantics semantics)
 
AccessSemantics accessSemantics () const
 
bool isReferenceType () const
 
bool isValueType () const
 
bool isIdInCurrentQmlScopes (const QString &id) const
 
bool isIdInCurrentJSScopes (const QString &id) const
 
bool isIdInjectedFromSignal (const QString &id) const
 
std::optional< JavaScriptIdentifierfindJSIdentifier (const QString &id) const
 
std::optional< JavaScriptIdentifierJSIdentifier (const QString &id) const
 
QQmlJS::ConstPtrWrapperIterator childScopesBegin () const
 
QQmlJS::ConstPtrWrapperIterator childScopesEnd () const
 
void setInlineComponentName (const QString &inlineComponentName)
 
std::optional< QStringinlineComponentName () const
 
InlineComponentOrDocumentRootName enclosingInlineComponentName () const
 
QVector< QQmlJSScope::PtrchildScopes ()
 
QVector< QQmlJSScope::ConstPtrchildScopes () const
 
void setSourceLocation (const QQmlJS::SourceLocation &sourceLocation)
 
QQmlJS::SourceLocation sourceLocation () const
 
bool isSameType (const QQmlJSScope::ConstPtr &otherScope) const
 
bool inherits (const QQmlJSScope::ConstPtr &base) const
 
bool canAssign (const QQmlJSScope::ConstPtr &derived) const
 
bool isInCustomParserParent () const
 

Static Public Member Functions

static QQmlJSScope::Ptr create ()
 
static QQmlJSScope::Ptr create (const QString &internalName)
 
static QQmlJSScope::Ptr clone (const QQmlJSScope::ConstPtr &origin)
 
static QQmlJSScope::ConstPtr findCurrentQMLScope (const QQmlJSScope::ConstPtr &scope)
 
static void reparent (const QQmlJSScope::Ptr &parentScope, const QQmlJSScope::Ptr &childScope)
 
static QString prettyName (QAnyStringView name)
 
static bool causesImplicitComponentWrapping (const QQmlJSMetaProperty &property, const QQmlJSScope::ConstPtr &assignedType)
 Returns if assigning assignedType to property would require an implicit component wrapping.
 
static QString qualifiedNameFrom (const QString &moduleName, const QString &typeName, const QTypeRevision &firstRevision, const QTypeRevision &lastRevision)
 
static AnnotatedScope ownerOfProperty (const QQmlJSScope::ConstPtr &self, const QString &name)
 
static QTypeRevision resolveTypes (const Ptr &self, const QQmlJSScope::ContextualTypes &contextualTypes, QSet< QString > *usedTypes=nullptr)
 
static void resolveNonEnumTypes (const QQmlJSScope::Ptr &self, const QQmlJSScope::ContextualTypes &contextualTypes, QSet< QString > *usedTypes=nullptr)
 
static void resolveEnums (const QQmlJSScope::Ptr &self, const QQmlJSScope::ContextualTypes &contextualTypes, QSet< QString > *usedTypes=nullptr)
 
static void resolveList (const QQmlJSScope::Ptr &self, const QQmlJSScope::ConstPtr &arrayType)
 
static void resolveGeneralizedGroup (const QQmlJSScope::Ptr &self, const QQmlJSScope::ConstPtr &baseType, const QQmlJSScope::ContextualTypes &contextualTypes, QSet< QString > *usedTypes=nullptr)
 
static QQmlJSScope::ConstPtr nonCompositeBaseType (const QQmlJSScope::ConstPtr &type)
 
static QTypeRevision nonCompositeBaseRevision (const ImportedScope< QQmlJSScope::ConstPtr > &scope)
 
static ImportedScope< QQmlJSScope::ConstPtrfindType (const QString &name, const ContextualTypes &contextualTypes, QSet< QString > *usedTypes=nullptr)
 
static QQmlSA::Element createQQmlSAElement (const ConstPtr &)
 
static QQmlSA::Element createQQmlSAElement (ConstPtr &&)
 
static const QQmlJSScope::ConstPtrscope (const QQmlSA::Element &)
 
static constexpr qsizetype sizeofQQmlSAElement ()
 

Detailed Description

Tracks the types for the QmlCompiler.

QQmlJSScope tracks the types used in qml for the QmlCompiler.

Multiple QQmlJSScope objects might be created for the same conceptual type, except when reused due to extensive caching. Two QQmlJSScope objects are considered equal when they are backed by the same implementation, that is, they have the same internalName. The qualifiedName of the QQmlJSScope for a type imported from multiple modules will contain the name of one of the modules that imported it, which is not unique and might change depending on the caching in .

Definition at line 97 of file qqmljsscope_p.h.

Member Typedef Documentation

◆ AccessSemantics

◆ ConstPtr

Definition at line 108 of file qqmljsscope_p.h.

◆ InlineComponentNameType

Definition at line 114 of file qqmljsscope_p.h.

◆ InlineComponentOrDocumentRootName

A Hashable type to differentiate document roots from different inline components.

Definition at line 119 of file qqmljsscope_p.h.

◆ Ptr

◆ RootDocumentNameType

using QQmlJSScope::RootDocumentNameType = std::monostate

Definition at line 115 of file qqmljsscope_p.h.

◆ ScopeType

Definition at line 112 of file qqmljsscope_p.h.

◆ WeakConstPtr

◆ WeakPtr

Member Enumeration Documentation

◆ BindingTargetSpecifier

Enumerator
SimplePropertyTarget 
ListPropertyTarget 
UnnamedPropertyTarget 

Definition at line 284 of file qqmljsscope_p.h.

◆ ExtensionKind

Enumerator
NotExtension 
ExtensionType 
ExtensionNamespace 

Definition at line 497 of file qqmljsscope_p.h.

◆ Flag

Enumerator
Creatable 
Composite 
Singleton 
Script 
CustomParser 
Array 
InlineComponent 
WrappedInImplicitComponent 
HasBaseTypeError 
HasExtensionNamespace 
IsListProperty 
Structured 

Definition at line 122 of file qqmljsscope_p.h.

Constructor & Destructor Documentation

◆ QQmlJSScope() [1/2]

QQmlJSScope::QQmlJSScope ( const QString internalName)
explicit

Definition at line 38 of file qqmljsscope.cpp.

References QQmlJSScope(), and internalName().

Referenced by QQmlJSScope().

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

◆ QQmlJSScope() [2/2]

QQmlJSScope::QQmlJSScope ( QQmlJSScope &&  )
default

Member Function Documentation

◆ accessSemantics()

◆ addOwnEnumeration()

void QQmlJSScope::addOwnEnumeration ( const QQmlJSMetaEnum enumeration)
inline

Definition at line 335 of file qqmljsscope_p.h.

References QQmlJSMetaEnum::name().

Referenced by QQmlJSImportVisitor::visit().

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

◆ addOwnMethod()

void QQmlJSScope::addOwnMethod ( const QQmlJSMetaMethod method)
inline

Definition at line 325 of file qqmljsscope_p.h.

References method.

Referenced by insertPropertyIdentifier(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ addOwnProperty()

void QQmlJSScope::addOwnProperty ( const QQmlJSMetaProperty prop)
inline

Definition at line 425 of file qqmljsscope_p.h.

References QQmlJSMetaProperty::propertyName().

Referenced by insertPropertyIdentifier(), and QQmlJSImportVisitor::visit().

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

◆ addOwnPropertyBinding()

void QQmlJSScope::addOwnPropertyBinding ( const QQmlJSMetaPropertyBinding binding,
BindingTargetSpecifier  specifier = BindingTargetSpecifier::SimplePropertyTarget 
)
inline

Definition at line 438 of file qqmljsscope_p.h.

References QQmlJS::SourceLocation::isValid(), iter, QQmlJSMetaPropertyBinding::propertyName(), Q_ASSERT, and QQmlJSMetaPropertyBinding::sourceLocation().

+ Here is the call graph for this function:

◆ addOwnRuntimeFunctionIndex()

void QQmlJSScope::addOwnRuntimeFunctionIndex ( QQmlJSMetaMethod::AbsoluteFunctionIndex  index)
inline

Definition at line 521 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::synthesizeCompilationUnitRuntimeFunctionIndices().

+ Here is the caller graph for this function:

◆ annotations()

const QList< QQmlJSAnnotation > & QQmlJSScope::annotations ( ) const
inline

Definition at line 346 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::checkDeprecation().

+ Here is the caller graph for this function:

◆ attachedType()

QQmlJSScope::ConstPtr QQmlJSScope::attachedType ( ) const

Definition at line 1057 of file qqmljsscope.cpp.

References QDeferredSharedPointer< T >::isNull(), NotExtension, ownAttachedType(), ptr(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlJSLinter::lintModule(), and QQmlJSTypeResolver::memberType().

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

◆ attachedTypeName()

QString QQmlJSScope::attachedTypeName ( ) const

Definition at line 1041 of file qqmljsscope.cpp.

References QDeferredSharedPointer< T >::isNull(), NotExtension, ownAttachedType(), ownAttachedTypeName(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

+ Here is the call graph for this function:

◆ augmentedInternalName()

QString QQmlJSScope::augmentedInternalName ( ) const
inline

Definition at line 355 of file qqmljsscope_p.h.

References base.

Referenced by QQmlJSCodeGenerator::AccumulatorConverter::AccumulatorConverter(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), and QQmlJSCodeGenerator::run().

+ Here is the caller graph for this function:

◆ baseType()

◆ baseTypeError()

QString QQmlJSScope::baseTypeError ( ) const

Definition at line 1036 of file qqmljsscope.cpp.

References HasBaseTypeError.

Referenced by QQmlJSImportVisitor::breakInheritanceCycles(), and setBaseTypeError().

+ Here is the caller graph for this function:

◆ baseTypeName()

QString QQmlJSScope::baseTypeName ( ) const

Definition at line 1025 of file qqmljsscope.cpp.

References HasBaseTypeError.

Referenced by QQmlSA::Element::baseTypeName(), QQmlJSImportVisitor::breakInheritanceCycles(), QQmlJSImportVisitor::endVisit(), getScopeName(), setBaseTypeName(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ baseTypeRevision()

QTypeRevision QQmlJSScope::baseTypeRevision ( ) const
inline

Definition at line 411 of file qqmljsscope_p.h.

Referenced by isRevisionAllowed().

+ Here is the caller graph for this function:

◆ canAssign()

bool QQmlJSScope::canAssign ( const QQmlJSScope::ConstPtr derived) const

Checks whether derived type can be assigned to this type. Returns true if the type hierarchy of derived contains a type equal to this.

Note
Assigning derived to "QVariant" or "QJSValue" is always possible and the function returns true in this case. In addition any "QObject" based derived type can be assigned to a this type if that type is derived from "QQmlComponent".

Definition at line 1179 of file qqmljsscope.cpp.

References baseType(), canAssign(), derived, QDuplicateTracker< T, Prealloc >::hasSeen(), internalName(), isComposite(), isListProperty(), QDeferredSharedPointer< T >::isNull(), isSameType(), nonCompositeBaseType(), Q_ASSERT, scope(), and valueType().

Referenced by canAssign().

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

◆ causesImplicitComponentWrapping()

bool QQmlJSScope::causesImplicitComponentWrapping ( const QQmlJSMetaProperty property,
const QQmlJSScope::ConstPtr assignedType 
)
static

Returns if assigning assignedType to property would require an implicit component wrapping.

Definition at line 234 of file qqmljsscope.cpp.

References nonCompositeBaseType(), and Q_ASSERT.

Referenced by QQmlJSImportVisitor::processDefaultProperties(), and QQmlJSImportVisitor::processPropertyBindingObjects().

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

◆ childScopes() [1/2]

QVector< QQmlJSScope::Ptr > QQmlJSScope::childScopes ( )
inline

Definition at line 594 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::checkGroupedAndAttachedScopes(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::enterEnvironmentNonUnique(), qFindInlineComponents(), and QQmlJSUtils::traverseFollowingQmlIrObjectStructure().

+ Here is the caller graph for this function:

◆ childScopes() [2/2]

QVector< QQmlJSScope::ConstPtr > QQmlJSScope::childScopes ( ) const
inline

Definition at line 599 of file qqmljsscope_p.h.

References child.

◆ childScopesBegin()

QQmlJS::ConstPtrWrapperIterator QQmlJSScope::childScopesBegin ( ) const
inline

Definition at line 583 of file qqmljsscope_p.h.

Referenced by QQmlSA::Element::childScopesBegin().

+ Here is the caller graph for this function:

◆ childScopesEnd()

QQmlJS::ConstPtrWrapperIterator QQmlJSScope::childScopesEnd ( ) const
inline

Definition at line 584 of file qqmljsscope_p.h.

Referenced by QQmlSA::Element::childScopesEnd().

+ Here is the caller graph for this function:

◆ clearBaseType()

void QQmlJSScope::clearBaseType ( )
inline

Definition at line 421 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::breakInheritanceCycles().

+ Here is the caller graph for this function:

◆ clone()

QQmlJSScope::Ptr QQmlJSScope::clone ( const QQmlJSScope::ConstPtr origin)
static

Definition at line 52 of file qqmljsscope.cpp.

References create(), QDeferredSharedPointer< T >::isNull(), parent, and parentScope().

Referenced by QQmlJSTypeResolver::adjustOriginalType(), QQmlJSTypeResolver::adjustTrackedType(), QQmlJSTypeResolver::adjustTrackedType(), QQmlJSTypeResolver::generalizeType(), resolveEnums(), QQmlJSTypeResolver::trackedType(), and QQmlJSImportVisitor::visit().

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

◆ create() [1/2]

static QQmlJSScope::Ptr QQmlJSScope::create ( )
inlinestatic

Definition at line 290 of file qqmljsscope_p.h.

Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), clone(), QQmlJSImportVisitor::enterEnvironment(), QQmlJSLinter::lintFile(), resolveEnums(), resolveList(), and QQmlJSAotCompiler::setDocument().

+ Here is the caller graph for this function:

◆ create() [2/2]

static QQmlJSScope::Ptr QQmlJSScope::create ( const QString internalName)
inlinestatic

Definition at line 291 of file qqmljsscope_p.h.

References internalName().

+ Here is the call graph for this function:

◆ createQQmlSAElement() [1/2]

◆ createQQmlSAElement() [2/2]

QQmlSA::Element QQmlJSScope::createQQmlSAElement ( ConstPtr &&  ptr)
static

Definition at line 1305 of file qqmljsscope.cpp.

References ptr().

+ Here is the call graph for this function:

◆ defaultPropertyName()

QString QQmlJSScope::defaultPropertyName ( ) const

Definition at line 1088 of file qqmljsscope.cpp.

References QString::isEmpty(), ownDefaultPropertyName(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlSA::Element::defaultPropertyName(), and QQmlJSImportVisitor::processDefaultProperties().

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

◆ enclosingInlineComponentName()

QQmlJSScope::InlineComponentOrDocumentRootName QQmlJSScope::enclosingInlineComponentName ( ) const

If this type is part of an inline component, return its name. Otherwise, if this type is part of the document root, return the document root name.

Definition at line 1244 of file qqmljsscope.cpp.

References get().

+ Here is the call graph for this function:

◆ enumeration()

QQmlJSMetaEnum QQmlJSScope::enumeration ( const QString name) const

Definition at line 178 of file qqmljsscope.cpp.

References QHash< Key, T >::end(), QHash< Key, T >::find(), it, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

+ Here is the call graph for this function:

◆ enumerations()

QHash< QString, QQmlJSMetaEnum > QQmlJSScope::enumerations ( ) const

Definition at line 193 of file qqmljsscope.cpp.

References QHash< Key, T >::constBegin(), QHash< Key, T >::constEnd(), QListSpecialMethodsBase< T >::contains(), QList< T >::insert(), it, results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

+ Here is the call graph for this function:

◆ extensionIsNamespace()

bool QQmlJSScope::extensionIsNamespace ( ) const
inline

Definition at line 553 of file qqmljsscope_p.h.

◆ extensionType()

AnnotatedScope QQmlJSScope::extensionType ( ) const
inline

Definition at line 507 of file qqmljsscope_p.h.

Referenced by QQmlJSCodeGenerator::convertContained(), QQmlJSCodeGenerator::convertStored(), and QQmlJSCodeGenerator::generate_DefineObjectLiteral().

+ Here is the caller graph for this function:

◆ extensionTypeName()

QString QQmlJSScope::extensionTypeName ( ) const
inline

Definition at line 495 of file qqmljsscope_p.h.

◆ filePath()

QString QQmlJSScope::filePath ( ) const
inline

Definition at line 348 of file qqmljsscope_p.h.

Referenced by QQmlJSRegisterContent::descriptiveName(), and QQmlSA::Element::filePath().

+ Here is the caller graph for this function:

◆ findCurrentQMLScope()

QQmlJSScope::ConstPtr QQmlJSScope::findCurrentQMLScope ( const QQmlJSScope::ConstPtr scope)
static

Definition at line 741 of file qqmljsscope.cpp.

References parentScope(), QQmlSA::QMLScope, and scope().

Referenced by isIdInCurrentQmlScopes(), and QQmlJSTypeResolver::scopedType().

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

◆ findJSIdentifier()

std::optional< QQmlJSScope::JavaScriptIdentifier > QQmlJSScope::findJSIdentifier ( const QString id) const

Definition at line 323 of file qqmljsscope.cpp.

References it, QQmlSA::JSFunctionScope, QQmlSA::JSLexicalScope, parentScope(), and scope().

Referenced by isIdInjectedFromSignal(), and QQmlJSTypeResolver::memberType().

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

◆ findType()

QQmlJSScope::ImportedScope< QQmlJSScope::ConstPtr > QQmlJSScope::findType ( const QString name,
const ContextualTypes contextualTypes,
QSet< QString > *  usedTypes = nullptr 
)
static

Finds a type in contextualTypes with given name. If a type is found, then its name is inserted into usedTypes (when provided). If contextualTypes has mode INTERNAl, then namespace resolution for enums is done (eg for Qt::Alignment). If contextualTypes has mode QML, then inline component resolution is done ("qmlFileName.IC" is correctly resolved from qmlFileName).

Definition at line 383 of file qqmljsscope.cpp.

References QQmlJSScope::ContextualTypes::context(), findType(), QSet< T >::insert(), QQmlJSScope::ContextualTypes::INTERNAL, isReferenceType(), QString::left(), QString::length(), listType(), QString::mid(), qFindInlineComponents(), QQmlJSScope::ContextualTypes::QML, QStringLiteral, QQmlJSScope::ImportedScope< Pointer >::revision, QQmlJSScope::ImportedScope< Pointer >::scope, and QQmlJSScope::ContextualTypes::types().

Referenced by findType(), QQmlJSImportVisitor::processPropertyTypes(), and resolveEnums().

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

◆ hasCreatableFlag()

bool QQmlJSScope::hasCreatableFlag ( ) const
inline

Definition at line 537 of file qqmljsscope_p.h.

Referenced by isCreatable().

+ Here is the caller graph for this function:

◆ hasCustomParser()

bool QQmlJSScope::hasCustomParser ( ) const
inline

Definition at line 549 of file qqmljsscope_p.h.

Referenced by isInCustomParserParent().

+ Here is the caller graph for this function:

◆ hasEnumeration()

bool QQmlJSScope::hasEnumeration ( const QString name) const

Definition at line 161 of file qqmljsscope.cpp.

References QHash< Key, T >::contains(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

+ Here is the call graph for this function:

◆ hasEnumerationKey()

bool QQmlJSScope::hasEnumerationKey ( const QString name) const

Definition at line 167 of file qqmljsscope.cpp.

References e, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

+ Here is the call graph for this function:

◆ hasInterface()

bool QQmlJSScope::hasInterface ( const QString name) const

Definition at line 972 of file qqmljsscope.cpp.

References NotExtension, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlJSImportVisitor::endVisit(), and QQmlJSImportVisitor::processPropertyBindingObjects().

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

◆ hasMethod()

bool QQmlJSScope::hasMethod ( const QString name) const

Definition at line 92 of file qqmljsscope.cpp.

References QMultiHash< Key, T >::contains(), ExtensionNamespace, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlSA::Element::hasMethod().

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

◆ hasOwnEnumeration()

bool QQmlJSScope::hasOwnEnumeration ( const QString name) const
inline

Definition at line 338 of file qqmljsscope_p.h.

◆ hasOwnInterface()

bool QQmlJSScope::hasOwnInterface ( const QString name) const
inline

Definition at line 396 of file qqmljsscope_p.h.

◆ hasOwnMethod()

bool QQmlJSScope::hasOwnMethod ( const QString name) const
inline

Definition at line 328 of file qqmljsscope_p.h.

Referenced by QQmlJSTypeResolver::memberType(), and QQmlJSTypeResolver::scopedType().

+ Here is the caller graph for this function:

◆ hasOwnProperty()

bool QQmlJSScope::hasOwnProperty ( const QString name) const
inline

Definition at line 428 of file qqmljsscope_p.h.

Referenced by QQmlJSTypePropagator::generate_StoreNameCommon(), isPropertyRequired(), QQmlJSTypeResolver::memberType(), ownerOfProperty(), and QQmlJSTypeResolver::scopedType().

+ Here is the caller graph for this function:

◆ hasOwnPropertyBindings()

bool QQmlJSScope::hasOwnPropertyBindings ( const QString name) const
inline

Definition at line 466 of file qqmljsscope_p.h.

Referenced by QQmlSA::Element::hasOwnPropertyBindings(), hasPropertyBindings(), and propertyBindings().

+ Here is the caller graph for this function:

◆ hasProperty()

bool QQmlJSScope::hasProperty ( const QString name) const

Definition at line 749 of file qqmljsscope.cpp.

References QHash< Key, T >::contains(), ExtensionNamespace, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlSA::Element::hasProperty(), QQmlJSImportVisitor::processPropertyBindings(), QQmlJSFunctionInitializer::run(), and QQmlJSImportVisitor::visit().

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

◆ hasPropertyBindings()

bool QQmlJSScope::hasPropertyBindings ( const QString name) const

Definition at line 943 of file qqmljsscope.cpp.

References hasOwnPropertyBindings(), NotExtension, Q_ASSERT, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlSA::Element::hasPropertyBindings().

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

◆ hasStructuredFlag()

bool QQmlJSScope::hasStructuredFlag ( ) const
inline

Definition at line 540 of file qqmljsscope_p.h.

Referenced by isStructured().

+ Here is the caller graph for this function:

◆ inherits()

bool QQmlJSScope::inherits ( const QQmlJSScope::ConstPtr base) const
inline

Definition at line 667 of file qqmljsscope_p.h.

References base, baseType(), and get().

Referenced by QQmlSA::Element::inherits().

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

◆ inlineComponentName()

std::optional< QString > QQmlJSScope::inlineComponentName ( ) const

if this->isInlineComponent(), then this getter returns the name of the inline component.

Definition at line 1233 of file qqmljsscope.cpp.

References isInlineComponent(), and Q_ASSERT.

Referenced by qFindInlineComponents(), and QQmlJSImportVisitor::visit().

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

◆ insertJSIdentifier()

void QQmlJSScope::insertJSIdentifier ( const QString name,
const JavaScriptIdentifier identifier 
)

Definition at line 63 of file qqmljsscope.cpp.

References QQmlJSScope::JavaScriptIdentifier::Injected, QQmlSA::JSFunctionScope, QQmlJSScope::JavaScriptIdentifier::kind, QQmlJSScope::JavaScriptIdentifier::LexicalScoped, parentScope(), Q_ASSERT, and QQmlSA::QMLScope.

Referenced by QQmlJSImportVisitor::flushPendingSignalParameters(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().

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

◆ insertPropertyIdentifier()

void QQmlJSScope::insertPropertyIdentifier ( const QQmlJSMetaProperty prop)

Definition at line 78 of file qqmljsscope.cpp.

References addOwnMethod(), addOwnProperty(), method, and property.

Referenced by QQmlJSImportVisitor::visit().

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

◆ interfaceNames()

QStringList QQmlJSScope::interfaceNames ( ) const
inline

Definition at line 393 of file qqmljsscope_p.h.

◆ internalName()

◆ isArrayScope()

bool QQmlJSScope::isArrayScope ( ) const
inline

Definition at line 550 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::addDefaultProperties(), and QQmlJSUtils::traverseFollowingQmlIrObjectStructure().

+ Here is the caller graph for this function:

◆ isComponentRootElement()

bool QQmlJSScope::isComponentRootElement ( ) const

Returns true if the scope is the outermost element of a separate Component Either because it has been implicitly wrapped, e.g. due to an assignment to a Component property, or because it is the first (and only) child of a Component. For visitors: This method should only be called after implicit components are detected, that is, after QQmlJSImportVisitor::endVisit(UiProgram *) was called.

Definition at line 281 of file qqmljsscope.cpp.

References base, nonCompositeBaseType(), parentScope(), and WrappedInImplicitComponent.

+ Here is the call graph for this function:

◆ isComposite()

bool QQmlJSScope::isComposite ( ) const
inline

Returns true for objects defined from Qml, and false for objects declared from C++.

Definition at line 547 of file qqmljsscope_p.h.

Referenced by canAssign(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_As(), QQmlJSTypePropagator::generate_As(), QQmlJSCodeGenerator::generateEnumLookup(), QQmlSA::Element::isComposite(), isComposite(), isCreatable(), isResolved(), isRevisionAllowed(), isStructured(), QQmlSA::lookupName(), QQmlJSCodeGenerator::metaObject(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ isCreatable()

bool QQmlJSScope::isCreatable ( ) const

Returns true if the current type is creatable by checking all the required base classes. "Uncreatability" is only inherited from base types for composite types (in qml) and not for non-composite types (c++).

For the exact definition: A type is uncreatable if and only if one of its composite base type or its first non-composite base type matches following criteria: \list

  • the base type is a singleton, or
  • the base type is an attached type, or
  • the base type is a C++ type with the QML_UNCREATABLE or QML_ANONYMOUS macro, or
  • the base type is a type without default constructor (in that case, it really needs QML_UNCREATABLE or QML_ANONYMOUS) \endlist

Definition at line 1268 of file qqmljsscope.cpp.

References baseType(), QDeferredSharedPointer< T >::get(), hasCreatableFlag(), isComposite(), isSingleton(), QQmlSA::QMLScope, scope(), and scopeType().

+ Here is the call graph for this function:

◆ isFullyResolved()

bool QQmlJSScope::isFullyResolved ( ) const

Definition at line 1108 of file qqmljsscope.cpp.

References isResolved(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlJSLinter::lintModule(), and QQmlJSImportVisitor::visit().

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

◆ isIdInCurrentJSScopes()

bool QQmlJSScope::isIdInCurrentJSScopes ( const QString id) const

Definition at line 302 of file qqmljsscope.cpp.

References parentScope(), and QQmlSA::QMLScope.

Referenced by isIdInCurrentScope().

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

◆ isIdInCurrentQmlScopes()

bool QQmlJSScope::isIdInCurrentQmlScopes ( const QString id) const

Definition at line 291 of file qqmljsscope.cpp.

References QHash< Key, T >::contains(), QMultiHash< Key, T >::contains(), findCurrentQMLScope(), parentScope(), and QQmlSA::QMLScope.

Referenced by isIdInCurrentScope().

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

◆ isIdInCurrentScope()

bool QQmlJSScope::isIdInCurrentScope ( const QString id) const

Definition at line 87 of file qqmljsscope.cpp.

References isIdInCurrentJSScopes(), and isIdInCurrentQmlScopes().

+ Here is the call graph for this function:

◆ isIdInjectedFromSignal()

bool QQmlJSScope::isIdInjectedFromSignal ( const QString id) const

Definition at line 316 of file qqmljsscope.cpp.

References findJSIdentifier(), and QQmlJSScope::JavaScriptIdentifier::Injected.

+ Here is the call graph for this function:

◆ isInCustomParserParent()

bool QQmlJSScope::isInCustomParserParent ( ) const

Checks whether this type or its parents have a custom parser.

Definition at line 1218 of file qqmljsscope.cpp.

References baseType(), get(), hasCustomParser(), QDeferredSharedPointer< T >::isNull(), parentScope(), and scope().

Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::checkGroupedAndAttachedScopes(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::processDefaultProperties(), and QQmlJSImportVisitor::processPropertyBindings().

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

◆ isInlineComponent()

bool QQmlJSScope::isInlineComponent ( ) const
inline

Definition at line 551 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::checkRequiredProperties(), inlineComponentName(), and qFindInlineComponents().

+ Here is the caller graph for this function:

◆ isListProperty()

bool QQmlJSScope::isListProperty ( ) const
inline

Definition at line 568 of file qqmljsscope_p.h.

Referenced by canAssign(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::contentPointer(), QQmlJSCodeGenerator::contentType(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_DefineArray(), QQmlJSCodeGenerator::generate_GetLookup(), and QQmlJSCodeGenerator::generate_SetLookup().

+ Here is the caller graph for this function:

◆ isNameDeferred()

bool QQmlJSScope::isNameDeferred ( const QString name) const

Definition at line 982 of file qqmljsscope.cpp.

References ownDeferredNames(), ownImmediateNames(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlJSImportVisitor::endVisit(), and QQmlJSFunctionInitializer::run().

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

◆ isPropertyLocallyRequired()

bool QQmlJSScope::isPropertyLocallyRequired ( const QString name) const

Definition at line 847 of file qqmljsscope.cpp.

Referenced by isPropertyRequired().

+ Here is the caller graph for this function:

◆ isPropertyRequired()

bool QQmlJSScope::isPropertyRequired ( const QString name) const

Definition at line 824 of file qqmljsscope.cpp.

References ExtensionNamespace, hasOwnProperty(), if(), isPropertyLocallyRequired(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlSA::Element::isPropertyRequired().

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

◆ isReferenceType()

bool QQmlJSScope::isReferenceType ( ) const
inline

◆ isResolved()

bool QQmlJSScope::isResolved ( ) const

Definition at line 1073 of file qqmljsscope.cpp.

References baseType(), isComposite(), QString::isEmpty(), and nonCompositeBaseType().

Referenced by isFullyResolved().

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

◆ isSameType()

bool QQmlJSScope::isSameType ( const QQmlJSScope::ConstPtr otherScope) const
inline

Checks whether otherScope is the same type as this.

In addition to checking whether the scopes are identical, we also cover duplicate scopes with the same internal name.

Definition at line 660 of file qqmljsscope_p.h.

References QDeferredSharedPointer< T >::get(), internalName(), internalName(), and QString::isEmpty().

Referenced by canAssign().

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

◆ isScript()

bool QQmlJSScope::isScript ( ) const
inline

Definition at line 548 of file qqmljsscope_p.h.

◆ isSingleton()

bool QQmlJSScope::isSingleton ( ) const
inline

Definition at line 534 of file qqmljsscope_p.h.

Referenced by isCreatable().

+ Here is the caller graph for this function:

◆ isStructured()

bool QQmlJSScope::isStructured ( ) const

Definition at line 1289 of file qqmljsscope.cpp.

References baseType(), get(), hasStructuredFlag(), isComposite(), and scope().

+ Here is the call graph for this function:

◆ isValueType()

bool QQmlJSScope::isValueType ( ) const
inline

Definition at line 574 of file qqmljsscope_p.h.

◆ isWrappedInImplicitComponent()

bool QQmlJSScope::isWrappedInImplicitComponent ( ) const
inline

Definition at line 552 of file qqmljsscope_p.h.

◆ JSIdentifier()

std::optional< QQmlJSScope::JavaScriptIdentifier > QQmlJSScope::JSIdentifier ( const QString id) const

Definition at line 337 of file qqmljsscope.cpp.

References it.

◆ listType() [1/2]

QQmlJSScope::Ptr QQmlJSScope::listType ( )
inline

Definition at line 519 of file qqmljsscope_p.h.

◆ listType() [2/2]

QQmlJSScope::ConstPtr QQmlJSScope::listType ( ) const
inline

Definition at line 518 of file qqmljsscope_p.h.

Referenced by QQmlJSTypeResolver::areEquivalentLists(), findType(), and resolveList().

+ Here is the caller graph for this function:

◆ methods() [1/3]

QHash< QString, QQmlJSMetaMethod > QQmlJSScope::methods ( ) const

Returns all methods visible from this scope including those of base types and extensions.

Note
Methods that get shadowed are not included and only the version visible from this scope is contained. Additionally method overrides are not included either, only the first visible version of any method is included.

Definition at line 111 of file qqmljsscope.cpp.

References QMultiHash< Key, T >::constBegin(), QMultiHash< Key, T >::constEnd(), QListSpecialMethodsBase< T >::contains(), ExtensionNamespace, QList< T >::insert(), it, results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlJSFunctionInitializer::run(), and QQmlJSImportVisitor::visit().

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

◆ methods() [2/3]

QList< QQmlJSMetaMethod > QQmlJSScope::methods ( const QString name) const

Definition at line 129 of file qqmljsscope.cpp.

References QList< T >::append(), ExtensionNamespace, ownMethods(), results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

+ Here is the call graph for this function:

◆ methods() [3/3]

QList< QQmlJSMetaMethod > QQmlJSScope::methods ( const QString name,
QQmlJSMetaMethodType  type 
) const

Definition at line 143 of file qqmljsscope.cpp.

References QList< T >::append(), ExtensionNamespace, method, ownMethods(), results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

+ Here is the call graph for this function:

◆ moduleName()

QString QQmlJSScope::moduleName ( ) const
inline

Definition at line 418 of file qqmljsscope_p.h.

Referenced by qualifiedNameFrom().

+ Here is the caller graph for this function:

◆ nonCompositeBaseRevision()

static QTypeRevision QQmlJSScope::nonCompositeBaseRevision ( const ImportedScope< QQmlJSScope::ConstPtr > &  scope)
inlinestatic

Definition at line 643 of file qqmljsscope_p.h.

References base.

Referenced by isRevisionAllowed().

+ Here is the caller graph for this function:

◆ nonCompositeBaseType()

static QQmlJSScope::ConstPtr QQmlJSScope::nonCompositeBaseType ( const QQmlJSScope::ConstPtr type)
inlinestatic

Definition at line 634 of file qqmljsscope_p.h.

References base.

Referenced by canAssign(), causesImplicitComponentWrapping(), QQmlJSCodeGenerator::contentType(), isComponentRootElement(), isResolved(), and QQmlJSTypeResolver::storedType().

+ Here is the caller graph for this function:

◆ operator=()

QQmlJSScope & QQmlJSScope::operator= ( QQmlJSScope &&  )
default

◆ ownAttachedType()

QQmlJSScope::ConstPtr QQmlJSScope::ownAttachedType ( ) const
inline

Definition at line 490 of file qqmljsscope_p.h.

Referenced by attachedType(), and attachedTypeName().

+ Here is the caller graph for this function:

◆ ownAttachedTypeName()

QString QQmlJSScope::ownAttachedTypeName ( ) const
inline

Definition at line 488 of file qqmljsscope_p.h.

Referenced by attachedTypeName().

+ Here is the caller graph for this function:

◆ ownDefaultPropertyName()

QString QQmlJSScope::ownDefaultPropertyName ( ) const
inline

Definition at line 480 of file qqmljsscope_p.h.

Referenced by defaultPropertyName().

+ Here is the caller graph for this function:

◆ ownDeferredNames()

QStringList QQmlJSScope::ownDeferredNames ( ) const
inline

Definition at line 399 of file qqmljsscope_p.h.

Referenced by isNameDeferred().

+ Here is the caller graph for this function:

◆ ownEnumeration()

QQmlJSMetaEnum QQmlJSScope::ownEnumeration ( const QString name) const
inline

Definition at line 337 of file qqmljsscope_p.h.

References QQmlJSMetaEnum::value().

+ Here is the call graph for this function:

◆ ownEnumerations()

QHash< QString, QQmlJSMetaEnum > QQmlJSScope::ownEnumerations ( ) const
inline

Definition at line 336 of file qqmljsscope_p.h.

Referenced by QQmlJSTypeResolver::checkEnums().

+ Here is the caller graph for this function:

◆ ownerOfProperty()

QQmlJSScope::AnnotatedScope QQmlJSScope::ownerOfProperty ( const QQmlJSScope::ConstPtr self,
const QString name 
)
static

Definition at line 799 of file qqmljsscope.cpp.

References ExtensionNamespace, hasOwnProperty(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

+ Here is the call graph for this function:

◆ ownImmediateNames()

QStringList QQmlJSScope::ownImmediateNames ( ) const
inline

Definition at line 401 of file qqmljsscope_p.h.

Referenced by isNameDeferred().

+ Here is the caller graph for this function:

◆ ownMethods() [1/2]

QMultiHash< QString, QQmlJSMetaMethod > QQmlJSScope::ownMethods ( ) const
inline

Definition at line 326 of file qqmljsscope_p.h.

Referenced by QQmlJSLinter::lintModule(), QQmlJSTypeResolver::memberType(), methods(), methods(), QQmlSA::Element::ownMethods(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ ownMethods() [2/2]

QList< QQmlJSMetaMethod > QQmlJSScope::ownMethods ( const QString name) const
inline

Definition at line 327 of file qqmljsscope_p.h.

◆ ownParentPropertyName()

QString QQmlJSScope::ownParentPropertyName ( ) const
inline

Definition at line 484 of file qqmljsscope_p.h.

Referenced by parentPropertyName().

+ Here is the caller graph for this function:

◆ ownProperties()

QHash< QString, QQmlJSMetaProperty > QQmlJSScope::ownProperties ( ) const
inline

Definition at line 426 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::checkRequiredProperties(), QQmlJSLinter::lintModule(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ ownProperty()

QQmlJSMetaProperty QQmlJSScope::ownProperty ( const QString name) const
inline

Definition at line 427 of file qqmljsscope_p.h.

Referenced by QQmlJSTypeResolver::memberType().

+ Here is the caller graph for this function:

◆ ownPropertyBindings() [1/2]

QMultiHash< QString, QQmlJSMetaPropertyBinding > QQmlJSScope::ownPropertyBindings ( ) const
inline

Definition at line 455 of file qqmljsscope_p.h.

Referenced by createNonUniqueScopeBinding(), QQmlSA::Element::ownPropertyBindings(), QQmlSA::Element::ownPropertyBindings(), and propertyBindings().

+ Here is the caller graph for this function:

◆ ownPropertyBindings() [2/2]

QPair< QMultiHash< QString, QQmlJSMetaPropertyBinding >::const_iterator, QMultiHash< QString, QQmlJSMetaPropertyBinding >::const_iterator > QQmlJSScope::ownPropertyBindings ( const QString name) const
inline

Definition at line 461 of file qqmljsscope_p.h.

◆ ownPropertyBindingsInQmlIROrder()

QList< QQmlJSMetaPropertyBinding > QQmlJSScope::ownPropertyBindingsInQmlIROrder ( ) const

Definition at line 925 of file qqmljsscope.cpp.

References QList< T >::append(), QMultiHash< Key, T >::equal_range(), Q_ASSERT, and QList< T >::reserve().

+ Here is the call graph for this function:

◆ ownRuntimeFunctionIndex()

QQmlJSMetaMethod::AbsoluteFunctionIndex QQmlJSScope::ownRuntimeFunctionIndex ( QQmlJSMetaMethod::RelativeFunctionIndex  index) const
inline

Definition at line 526 of file qqmljsscope_p.h.

References i, and Q_ASSERT.

◆ parentPropertyName()

QString QQmlJSScope::parentPropertyName ( ) const

Definition at line 1098 of file qqmljsscope.cpp.

References QString::isEmpty(), ownParentPropertyName(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

+ Here is the call graph for this function:

◆ parentScope() [1/2]

◆ parentScope() [2/2]

QQmlJSScope::ConstPtr QQmlJSScope::parentScope ( ) const
inline

Definition at line 303 of file qqmljsscope_p.h.

References QT_WARNING_DISABLE_GCC, QT_WARNING_POP, QT_WARNING_PUSH, and QDeferredWeakPointer< T >::toStrongRef().

+ Here is the call graph for this function:

◆ prettyName()

QString QQmlJSScope::prettyName ( QAnyStringView  name)
static

Definition at line 209 of file qqmljsscope.cpp.

References QString::mid(), QString::size(), and QString::startsWith().

Referenced by QQmlSA::Element::baseTypeName(), QQmlJSTypeResolver::containedTypeName(), QQmlSA::Element::name(), and QQmlJSLiteralBindingCheck::run().

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

◆ properties()

QHash< QString, QQmlJSMetaProperty > QQmlJSScope::properties ( ) const

Returns all properties visible from this scope including those of base types and extensions.

Note
Properties that get shadowed are not included and only the version visible from this scope is contained.

Definition at line 782 of file qqmljsscope.cpp.

References QHash< Key, T >::constBegin(), QHash< Key, T >::constEnd(), QListSpecialMethodsBase< T >::contains(), ExtensionNamespace, QList< T >::insert(), it, results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

+ Here is the call graph for this function:

◆ property()

QQmlJSMetaProperty QQmlJSScope::property ( const QString name) const

Definition at line 759 of file qqmljsscope.cpp.

References QHash< Key, T >::end(), ExtensionNamespace, QHash< Key, T >::find(), it, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlJSUtils::changeHandlerProperty(), QQmlJSTypePropagator::generate_CallProperty(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSImportVisitor::processDefaultProperties(), QQmlJSImportVisitor::processPropertyBindings(), QQmlSA::Element::property(), resolveAlias(), and QQmlJSFunctionInitializer::run().

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

◆ propertyBindings()

QList< QQmlJSMetaPropertyBinding > QQmlJSScope::propertyBindings ( const QString name) const

Definition at line 955 of file qqmljsscope.cpp.

References QList< T >::append(), hasOwnPropertyBindings(), it, NotExtension, ownPropertyBindings(), Q_ASSERT, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by QQmlSA::Element::propertyBindings().

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

◆ Q_FLAGS()

QQmlJSScope::Q_FLAGS ( Flags  )

◆ qualifiedName()

QString QQmlJSScope::qualifiedName ( ) const
inline

Definition at line 413 of file qqmljsscope_p.h.

Referenced by qualifiedNameFrom().

+ Here is the caller graph for this function:

◆ qualifiedNameFrom()

QString QQmlJSScope::qualifiedNameFrom ( const QString moduleName,
const QString typeName,
const QTypeRevision firstRevision,
const QTypeRevision lastRevision 
)
static

Definition at line 1003 of file qqmljsscope.cpp.

References QString::arg(), arg, QTypeRevision::hasMajorVersion(), QTypeRevision::hasMinorVersion(), QTypeRevision::majorVersion(), QTypeRevision::minorVersion(), moduleName(), qualifiedName(), and typeName.

+ Here is the call graph for this function:

◆ reparent()

void QQmlJSScope::reparent ( const QQmlJSScope::Ptr parentScope,
const QQmlJSScope::Ptr childScope 
)
static

Definition at line 43 of file qqmljsscope.cpp.

References parent, parentScope(), and QDeferredWeakPointer< T >::toStrongRef().

Referenced by QQmlJSImportVisitor::enterEnvironment(), and resolveEnums().

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

◆ resolveEnums()

void QQmlJSScope::resolveEnums ( const QQmlJSScope::Ptr self,
const QQmlJSScope::ContextualTypes contextualTypes,
QSet< QString > *  usedTypes = nullptr 
)
static

Resolves all enums of self.

Some enums happen to have an alias, e.g. when an enum is used as a flag, the enum will exist in two versions, once as enum (e.g. Qt::MouseButton) and once as a flag (e.g. Qt::MouseButtons). In this case, normally only the flag is exposed to the qt metatype system and tools like qmltc will have troubles when encountering the enum in signal parameters etc. To solve this problem, resolveEnums() will create a QQmlJSMetaEnum copy for the alias in case the 'self'-scope already does not have an enum called like the alias.

Definition at line 655 of file qqmljsscope.cpp.

References QString::begin(), clone(), QString::constEnd(), create(), QString::end(), QQmlSA::EnumScope, findType(), flagStorage(), QHash< Key, T >::insert(), QString::insert(), it, QStringLiteral, reparent(), setBaseTypeName(), QQmlJSMetaEnum::setType(), and typeName.

Referenced by resolveTypes().

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

◆ resolveGeneralizedGroup()

void QQmlJSScope::resolveGeneralizedGroup ( const QQmlJSScope::Ptr self,
const QQmlJSScope::ConstPtr baseType,
const QQmlJSScope::ContextualTypes contextualTypes,
QSet< QString > *  usedTypes = nullptr 
)
static

Definition at line 727 of file qqmljsscope.cpp.

References accessSemantics(), baseType(), Q_ASSERT, and resolveNonEnumTypes().

+ Here is the call graph for this function:

◆ resolveList()

void QQmlJSScope::resolveList ( const QQmlJSScope::Ptr self,
const QQmlJSScope::ConstPtr arrayType 
)
static

Definition at line 693 of file qqmljsscope.cpp.

References create(), QQmlJSScope::ContextualTypes::INTERNAL, QDeferredSharedPointer< T >::isNull(), listType(), Q_ASSERT, resolveTypes(), setAccessSemantics(), setFilePath(), setInternalName(), setValueTypeName(), and valueType().

Referenced by resolveTypes().

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

◆ resolveNonEnumTypes()

void QQmlJSScope::resolveNonEnumTypes ( const QQmlJSScope::Ptr self,
const QQmlJSScope::ContextualTypes contextualTypes,
QSet< QString > *  usedTypes = nullptr 
)
static

Definition at line 614 of file qqmljsscope.cpp.

References resolveTypesInternal().

Referenced by resolveGeneralizedGroup().

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

◆ resolveTypes()

QTypeRevision QQmlJSScope::resolveTypes ( const Ptr self,
const QQmlJSScope::ContextualTypes contextualTypes,
QSet< QString > *  usedTypes = nullptr 
)
static

Definition at line 600 of file qqmljsscope.cpp.

References QQmlJSScope::ContextualTypes::arrayType(), resolveEnums(), resolveList(), and resolveTypesInternal().

Referenced by QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), resolveList(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().

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

◆ scope()

const QQmlJSScope::ConstPtr & QQmlJSScope::scope ( const QQmlSA::Element element)
static

Definition at line 1312 of file qqmljsscope.cpp.

Referenced by QQmlSA::Element::Element(), QQmlSA::Element::accessSemantics(), attachedType(), attachedTypeName(), QQmlSA::Element::baseType(), QQmlSA::Element::baseTypeName(), canAssign(), QQmlSA::Element::childScopesBegin(), QQmlSA::Element::childScopesEnd(), defaultPropertyName(), QQmlSA::Element::defaultPropertyName(), enumeration(), enumerations(), QQmlSA::Element::filePath(), findCurrentQMLScope(), findJSIdentifier(), hasEnumeration(), hasEnumerationKey(), hasInterface(), QQmlSA::Element::hasMethod(), hasMethod(), QQmlSA::Element::hasOwnPropertyBindings(), hasProperty(), QQmlSA::Element::hasProperty(), hasPropertyBindings(), QQmlSA::Element::hasPropertyBindings(), QQmlSA::Element::inherits(), QQmlSA::Element::internalId(), QQmlSA::Element::isComposite(), isCreatable(), isFullyResolved(), isInCustomParserParent(), isNameDeferred(), QQmlSA::Element::isNull(), isPropertyRequired(), QQmlSA::Element::isPropertyRequired(), isStructured(), QQmlSA::lookupName(), methods(), methods(), methods(), QQmlSA::Element::name(), QQmlSA::DebugPropertyPass::onBinding(), QQmlSA::DebugPropertyPass::onRead(), QQmlSA::DebugPropertyPass::onWrite(), QQmlSA::Element::operator bool(), QQmlSA::Element::operator!(), QQmlSA::Element::operator=(), ownerOfProperty(), QQmlSA::Element::ownMethods(), QQmlSA::Element::ownPropertyBindings(), QQmlSA::Element::ownPropertyBindings(), parentPropertyName(), QQmlSA::Element::parentScope(), properties(), property(), QQmlSA::Element::property(), propertyBindings(), QQmlSA::Element::propertyBindings(), QQmlSA::GenericPass::resolveAttached(), QQmlSA::GenericPass::resolveAttachedInFileScope(), QQmlSA::GenericPass::resolveElementToId(), QQmlSA::GenericPass::resolveIdToElement(), QQmlSA::Element::scopeType(), and QQmlSA::Element::sourceLocation().

◆ scopeType()

◆ setAccessSemantics()

void QQmlJSScope::setAccessSemantics ( AccessSemantics  semantics)
inline

Definition at line 571 of file qqmljsscope_p.h.

Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), and resolveList().

+ Here is the caller graph for this function:

◆ setAnnotations()

void QQmlJSScope::setAnnotations ( const QList< QQmlJSAnnotation > &  annotation)
inline

Definition at line 345 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setBaseTypeError()

void QQmlJSScope::setBaseTypeError ( const QString baseTypeError)

Definition at line 1030 of file qqmljsscope.cpp.

References baseTypeError(), and HasBaseTypeError.

Referenced by QQmlJSImportVisitor::breakInheritanceCycles().

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

◆ setBaseTypeName()

void QQmlJSScope::setBaseTypeName ( const QString baseTypeName)

Definition at line 1019 of file qqmljsscope.cpp.

References baseTypeName(), and HasBaseTypeError.

Referenced by resolveEnums(), and setScopeName().

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

◆ setCreatableFlag()

void QQmlJSScope::setCreatableFlag ( bool  v)
inline

Definition at line 555 of file qqmljsscope_p.h.

◆ setExtensionIsNamespace()

void QQmlJSScope::setExtensionIsNamespace ( bool  v)
inline

Definition at line 566 of file qqmljsscope_p.h.

◆ setExtensionTypeName()

void QQmlJSScope::setExtensionTypeName ( const QString name)
inline

Definition at line 496 of file qqmljsscope_p.h.

◆ setFilePath()

void QQmlJSScope::setFilePath ( const QString file)
inline

Definition at line 349 of file qqmljsscope_p.h.

References file.

Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), and resolveList().

+ Here is the caller graph for this function:

◆ setHasCustomParser()

void QQmlJSScope::setHasCustomParser ( bool  v)
inline

Definition at line 559 of file qqmljsscope_p.h.

◆ setInlineComponentName()

void QQmlJSScope::setInlineComponentName ( const QString inlineComponentName)
inline

Definition at line 586 of file qqmljsscope_p.h.

References Q_ASSERT.

Referenced by QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setInterfaceNames()

void QQmlJSScope::setInterfaceNames ( const QStringList interfaces)
inline

Definition at line 392 of file qqmljsscope_p.h.

◆ setInternalName()

void QQmlJSScope::setInternalName ( const QString internalName)
inline

Definition at line 354 of file qqmljsscope_p.h.

References internalName().

Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), resolveList(), and setScopeName().

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

◆ setIsArrayScope()

void QQmlJSScope::setIsArrayScope ( bool  v)
inline

Definition at line 563 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setIsComposite()

void QQmlJSScope::setIsComposite ( bool  v)
inline

Definition at line 557 of file qqmljsscope_p.h.

◆ setIsInlineComponent()

void QQmlJSScope::setIsInlineComponent ( bool  v)
inline

Definition at line 564 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setIsListProperty()

void QQmlJSScope::setIsListProperty ( bool  v)
inline

Definition at line 569 of file qqmljsscope_p.h.

◆ setIsScript()

void QQmlJSScope::setIsScript ( bool  v)
inline

Definition at line 558 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setIsSingleton()

void QQmlJSScope::setIsSingleton ( bool  v)
inline

Definition at line 554 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setIsWrappedInImplicitComponent()

void QQmlJSScope::setIsWrappedInImplicitComponent ( bool  v)
inline

Definition at line 565 of file qqmljsscope_p.h.

◆ setModuleName()

void QQmlJSScope::setModuleName ( const QString moduleName)
inline

Definition at line 419 of file qqmljsscope_p.h.

◆ setOwnAttachedTypeName()

void QQmlJSScope::setOwnAttachedTypeName ( const QString name)
inline

Definition at line 489 of file qqmljsscope_p.h.

◆ setOwnDefaultPropertyName()

void QQmlJSScope::setOwnDefaultPropertyName ( const QString name)
inline

Definition at line 481 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setOwnDeferredNames()

void QQmlJSScope::setOwnDeferredNames ( const QStringList names)
inline

Definition at line 398 of file qqmljsscope_p.h.

◆ setOwnImmediateNames()

void QQmlJSScope::setOwnImmediateNames ( const QStringList names)
inline

Definition at line 400 of file qqmljsscope_p.h.

◆ setOwnParentPropertyName()

void QQmlJSScope::setOwnParentPropertyName ( const QString name)
inline

Definition at line 485 of file qqmljsscope_p.h.

◆ setPropertyLocallyRequired()

void QQmlJSScope::setPropertyLocallyRequired ( const QString name,
bool  isRequired 
)

Definition at line 816 of file qqmljsscope.cpp.

Referenced by QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setQualifiedName()

void QQmlJSScope::setQualifiedName ( const QString qualifiedName)
inline

Definition at line 414 of file qqmljsscope_p.h.

◆ setScopeType()

void QQmlJSScope::setScopeType ( ScopeType  type)
inline

Definition at line 323 of file qqmljsscope_p.h.

◆ setSourceLocation()

void QQmlJSScope::setSourceLocation ( const QQmlJS::SourceLocation sourceLocation)
inline

Definition at line 624 of file qqmljsscope_p.h.

◆ setStructuredFlag()

void QQmlJSScope::setStructuredFlag ( bool  v)
inline

Definition at line 556 of file qqmljsscope_p.h.

◆ setValueTypeName()

void QQmlJSScope::setValueTypeName ( const QString name)
inline

Definition at line 516 of file qqmljsscope_p.h.

Referenced by resolveList().

+ Here is the caller graph for this function:

◆ sizeofQQmlSAElement()

static constexpr qsizetype QQmlJSScope::sizeofQQmlSAElement ( )
inlinestaticconstexpr

Definition at line 724 of file qqmljsscope_p.h.

◆ sourceLocation()

QQmlJS::SourceLocation QQmlJSScope::sourceLocation ( ) const
inline

Definition at line 629 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::breakInheritanceCycles(), QQmlJSImportVisitor::checkDeprecation(), QQmlLSUtils::findDefinitionOf(), QQmlJSLinter::lintModule(), QQmlJSImportVisitor::rootScopeIsValid(), and QQmlSA::Element::sourceLocation().

+ Here is the caller graph for this function:

◆ valueType()

QQmlJSScope::ConstPtr QQmlJSScope::valueType ( ) const
inline

Definition at line 517 of file qqmljsscope_p.h.

Referenced by canAssign(), QQmlJSTypeResolver::canHold(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_DefineArray(), resolveList(), and QQmlJSTypeResolver::valueType().

+ Here is the caller graph for this function:

◆ valueTypeName()

QString QQmlJSScope::valueTypeName ( ) const
inline

Definition at line 515 of file qqmljsscope_p.h.


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