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
QQmlJSScope Class Reference

Tracks the types for the QmlCompiler. More...

#include <qqmljsscope_p.h>

+ Collaboration diagram for QQmlJSScope:

Classes

struct  AnnotatedScope
 
struct  JavaScriptIdentifier
 

Public Types

enum  Flag {
  Creatable = 0x1 , Composite = 0x2 , Singleton = 0x4 , Script = 0x8 ,
  CustomParser = 0x10 , Array = 0x20 , InlineComponent = 0x40 , WrappedInImplicitComponent = 0x80 ,
  HasBaseTypeError = 0x100 , ExtensionIsNamespace = 0x200 , IsListProperty = 0x400 , Structured = 0x800 ,
  ExtensionIsJavaScript = 0x1000
}
 
enum  BindingTargetSpecifier { SimplePropertyTarget , ListPropertyTarget , UnnamedPropertyTarget }
 
enum  ExtensionKind { NotExtension , ExtensionType , ExtensionJavaScript , 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
 A Hashable type to differentiate document roots from different inline components.
 
using Export = QQmlJS::Export
 
template<typename Pointer >
using ImportedScope = QQmlJS::ImportedScope<Pointer>
 
template<typename Pointer >
using ExportedScope = QQmlJS::ExportedScope<Pointer>
 
template<typename Key , typename Value >
using QMultiHashRange
 

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)
 
QHash< QString, JavaScriptIdentifierownJSIdentifiers () const
 
void insertPropertyIdentifier (const QQmlJSMetaProperty &prop)
 
ScopeType scopeType () const
 
void setScopeType (ScopeType type)
 
void addOwnMethod (const QQmlJSMetaMethod &method)
 
QMultiHashRange< QString, QQmlJSMetaMethodmutableOwnMethodsRange (const QString &name)
 
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
 
bool hasOwnEnumerationKey (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 setAliases (const QStringList &aliases)
 
QStringList aliases () 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 moduleName () const
 
QString ownModuleName () const
 
void setOwnModuleName (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 isComposite () const
 
bool isScript () const
 
bool hasCustomParser () const
 
bool isArrayScope () const
 
bool isInlineComponent () const
 
bool isWrappedInImplicitComponent () const
 
bool extensionIsJavaScript () const
 
bool extensionIsNamespace () const
 
bool isListProperty () const
 
void setIsListProperty (bool v)
 
bool isSingleton () const
 
bool isCreatable () const
 
bool isStructured () const
 
bool isReferenceType () const
 
bool isValueType () 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 setExtensionIsJavaScript (bool v)
 
void setExtensionIsNamespace (bool v)
 
void setAccessSemantics (AccessSemantics semantics)
 
AccessSemantics accessSemantics () const
 
std::optional< JavaScriptIdentifierjsIdentifier (const QString &id) const
 
std::optional< JavaScriptIdentifierownJSIdentifier (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 AnnotatedScope ownerOfProperty (const QQmlJSScope::ConstPtr &self, const QString &name)
 
static QTypeRevision resolveTypes (const Ptr &self, const QQmlJS::ContextualTypes &contextualTypes, QSet< QString > *usedTypes=nullptr)
 
static void resolveNonEnumTypes (const QQmlJSScope::Ptr &self, const QQmlJS::ContextualTypes &contextualTypes, QSet< QString > *usedTypes=nullptr)
 
static void resolveEnums (const QQmlJSScope::Ptr &self, const QQmlJS::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 QQmlJS::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 QQmlJS::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 ()
 

Friends

template<typename T >
class QTypeInfo
 

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.

Definition at line 130 of file qqmljsscope_p.h.

Member Typedef Documentation

◆ AccessSemantics

◆ ConstPtr

Definition at line 141 of file qqmljsscope_p.h.

◆ Export

Definition at line 173 of file qqmljsscope_p.h.

◆ ExportedScope

template<typename Pointer >
using QQmlJSScope::ExportedScope = QQmlJS::ExportedScope<Pointer>

Definition at line 177 of file qqmljsscope_p.h.

◆ ImportedScope

template<typename Pointer >
using QQmlJSScope::ImportedScope = QQmlJS::ImportedScope<Pointer>

Definition at line 175 of file qqmljsscope_p.h.

◆ InlineComponentNameType

Definition at line 147 of file qqmljsscope_p.h.

◆ InlineComponentOrDocumentRootName

Initial value:
std::variant<InlineComponentNameType, RootDocumentNameType>

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

Definition at line 152 of file qqmljsscope_p.h.

◆ Ptr

◆ QMultiHashRange

template<typename Key , typename Value >
using QQmlJSScope::QMultiHashRange
Initial value:
QPair<typename QMultiHash<Key, Value>::iterator,
\inmodule QtCore
Definition qhash.h:1788

Definition at line 202 of file qqmljsscope_p.h.

◆ RootDocumentNameType

using QQmlJSScope::RootDocumentNameType = std::monostate

Definition at line 148 of file qqmljsscope_p.h.

◆ ScopeType

Definition at line 145 of file qqmljsscope_p.h.

◆ WeakConstPtr

◆ WeakPtr

Member Enumeration Documentation

◆ BindingTargetSpecifier

Enumerator
SimplePropertyTarget 
ListPropertyTarget 
UnnamedPropertyTarget 

Definition at line 195 of file qqmljsscope_p.h.

◆ ExtensionKind

Enumerator
NotExtension 
ExtensionType 
ExtensionJavaScript 
ExtensionNamespace 

Definition at line 345 of file qqmljsscope_p.h.

◆ Flag

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

Definition at line 155 of file qqmljsscope_p.h.

Constructor & Destructor Documentation

◆ QQmlJSScope() [1/2]

QQmlJSScope::QQmlJSScope ( const QString & internalName)
explicit

Definition at line 36 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 236 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 222 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 296 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 )

Definition at line 830 of file qqmljsscope.cpp.

References QMultiHash< Key, T >::equal_range(), QMultiHash< Key, T >::insert(), QQmlJS::SourceLocation::isValid(), iter, QQmlJSMetaPropertyBinding::propertyName(), Q_ASSERT, QMultiHash< Key, T >::size(), QList< T >::size(), and QQmlJSMetaPropertyBinding::sourceLocation().

+ Here is the call graph for this function:

◆ addOwnRuntimeFunctionIndex()

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

Definition at line 1078 of file qqmljsscope.cpp.

References QList< T >::emplaceBack().

Referenced by QQmlJSImportVisitor::synthesizeCompilationUnitRuntimeFunctionIndices().

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

◆ aliases()

QStringList QQmlJSScope::aliases ( ) const
inline

Definition at line 265 of file qqmljsscope_p.h.

Referenced by aliases().

+ Here is the caller graph for this function:

◆ annotations()

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

Definition at line 248 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 1051 of file qqmljsscope.cpp.

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

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

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

◆ attachedTypeName()

QString QQmlJSScope::attachedTypeName ( ) const

Definition at line 1035 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ augmentedInternalName()

QString QQmlJSScope::augmentedInternalName ( ) const

Definition at line 221 of file qqmljsscope.cpp.

References base, and baseType().

Referenced by QQmlJSCodeGenerator::generate_DefineObjectLiteral().

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

◆ baseType()

◆ baseTypeError()

QString QQmlJSScope::baseTypeError ( ) const

Definition at line 1030 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 1003 of file qqmljsscope.cpp.

References HasBaseTypeError.

Referenced by 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 286 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 1182 of file qqmljsscope.cpp.

References derived, internalName(), isComposite(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ childScopes() [1/2]

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

Definition at line 614 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

Definition at line 1260 of file qqmljsscope.cpp.

References child.

◆ childScopesBegin()

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

Definition at line 409 of file qqmljsscope_p.h.

◆ childScopesEnd()

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

Definition at line 410 of file qqmljsscope_p.h.

◆ clearBaseType()

void QQmlJSScope::clearBaseType ( )
inline

Definition at line 292 of file qqmljsscope_p.h.

◆ clone()

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

Definition at line 55 of file qqmljsscope.cpp.

References create(), QDeferredSharedPointer< T >::isNull(), 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 205 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]

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

Definition at line 41 of file qqmljsscope.cpp.

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 1321 of file qqmljsscope.cpp.

References ptr().

+ Here is the call graph for this function:

◆ defaultPropertyName()

QString QQmlJSScope::defaultPropertyName ( ) const

Definition at line 1098 of file qqmljsscope.cpp.

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

Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::processDefaultProperties(), and QQmlJSTypeResolver::scopedType().

+ 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 1251 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 190 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ enumerations()

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

Definition at line 205 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ extensionIsJavaScript()

bool QQmlJSScope::extensionIsJavaScript ( ) const
inline

Definition at line 380 of file qqmljsscope_p.h.

◆ extensionIsNamespace()

bool QQmlJSScope::extensionIsNamespace ( ) const
inline

Definition at line 381 of file qqmljsscope_p.h.

◆ extensionType()

QQmlJSScope::AnnotatedScope QQmlJSScope::extensionType ( ) const

Definition at line 1067 of file qqmljsscope.cpp.

References ExtensionIsJavaScript, ExtensionIsNamespace, ExtensionJavaScript, ExtensionNamespace, ExtensionType, and NotExtension.

Referenced by QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), and QQmlJSTypeResolver::selectConstructor().

+ Here is the caller graph for this function:

◆ extensionTypeName()

QString QQmlJSScope::extensionTypeName ( ) const
inline

Definition at line 343 of file qqmljsscope_p.h.

◆ filePath()

QString QQmlJSScope::filePath ( ) const
inline

Definition at line 250 of file qqmljsscope_p.h.

Referenced by QQmlJSRegisterContent::descriptiveName().

+ Here is the caller graph for this function:

◆ findCurrentQMLScope()

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

Definition at line 719 of file qqmljsscope.cpp.

References QQmlSA::QMLScope, and scope().

Referenced by QQmlJSTypeResolver::scopedType().

+ 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 QQmlJS::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 361 of file qqmljsscope.cpp.

References findType(), QQmlJS::ContextualTypes::INTERNAL, isReferenceType(), QString::left(), QString::length(), listType(), QString::mid(), qFindInlineComponents(), QQmlJS::ContextualTypes::QML, and QStringLiteral.

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

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

◆ hasCustomParser()

bool QQmlJSScope::hasCustomParser ( ) const
inline

Definition at line 376 of file qqmljsscope_p.h.

◆ hasEnumeration()

bool QQmlJSScope::hasEnumeration ( const QString & name) const

Definition at line 169 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ hasEnumerationKey()

bool QQmlJSScope::hasEnumerationKey ( const QString & name) const

Definition at line 184 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ hasInterface()

bool QQmlJSScope::hasInterface ( const QString & name) const

Definition at line 966 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 100 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ hasOwnEnumeration()

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

Definition at line 239 of file qqmljsscope_p.h.

Referenced by findDefiningScopeForEnumeration().

+ Here is the caller graph for this function:

◆ hasOwnEnumerationKey()

bool QQmlJSScope::hasOwnEnumerationKey ( const QString & name) const

Definition at line 175 of file qqmljsscope.cpp.

Referenced by findDefiningScopeForEnumerationKey().

+ Here is the caller graph for this function:

◆ hasOwnInterface()

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

Definition at line 271 of file qqmljsscope_p.h.

◆ hasOwnMethod()

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

Definition at line 229 of file qqmljsscope_p.h.

Referenced by findDefiningScopeForBinding(), findDefiningScopeForMethod(), and QQmlJSTypeResolver::memberType().

+ Here is the caller graph for this function:

◆ hasOwnProperty()

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

Definition at line 299 of file qqmljsscope_p.h.

Referenced by findDefiningScopeForBinding(), findDefiningScopeForProperty(), and QQmlJSTypeResolver::memberType().

+ Here is the caller graph for this function:

◆ hasOwnPropertyBindings()

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

Definition at line 590 of file qqmljsscope_p.h.

References QMultiHash< Key, T >::contains().

Referenced by findScopeOfSpecialItems().

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

◆ hasProperty()

bool QQmlJSScope::hasProperty ( const QString & name) const

Definition at line 727 of file qqmljsscope.cpp.

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

Referenced by QQmlJSImportVisitor::processPropertyBindings(), resolveNameInQmlScope(), 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 937 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ inherits()

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

Definition at line 1358 of file qqmljsscope.cpp.

References base, and get().

+ Here is the call 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 1240 of file qqmljsscope.cpp.

References Q_ASSERT.

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

+ Here is the caller graph for this function:

◆ insertJSIdentifier()

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

Definition at line 75 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 90 of file qqmljsscope.cpp.

References addOwnMethod(), addOwnProperty(), method, property, and QQmlSignalNames::propertyNameToChangedSignalName().

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 268 of file qqmljsscope_p.h.

◆ internalName()

◆ isArrayScope()

bool QQmlJSScope::isArrayScope ( ) const
inline

Definition at line 377 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 282 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 374 of file qqmljsscope_p.h.

Referenced by QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generateEnumLookup(), isComposite(), isResolved(), isRevisionAllowed(), 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 1284 of file qqmljsscope.cpp.

References QQmlSA::QMLScope.

Referenced by testScopeSymbol().

+ Here is the caller graph for this function:

◆ isFullyResolved()

bool QQmlJSScope::isFullyResolved ( ) const

Definition at line 1118 of file qqmljsscope.cpp.

References 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:

◆ isInCustomParserParent()

bool QQmlJSScope::isInCustomParserParent ( ) const

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

Definition at line 1225 of file qqmljsscope.cpp.

References get().

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 378 of file qqmljsscope_p.h.

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

+ Here is the caller graph for this function:

◆ isListProperty()

bool QQmlJSScope::isListProperty ( ) const
inline

Definition at line 382 of file qqmljsscope_p.h.

Referenced by QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::contentPointer(), QQmlJSCodeGenerator::contentType(), and QQmlJSCodeGenerator::convertStored().

+ Here is the caller graph for this function:

◆ isNameDeferred()

bool QQmlJSScope::isNameDeferred ( const QString & name) const

Definition at line 976 of file qqmljsscope.cpp.

References 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 825 of file qqmljsscope.cpp.

◆ isPropertyRequired()

bool QQmlJSScope::isPropertyRequired ( const QString & name) const

Definition at line 802 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ isReferenceType()

bool QQmlJSScope::isReferenceType ( ) const
inline

◆ isResolved()

bool QQmlJSScope::isResolved ( ) const

Definition at line 1083 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ isSameType()

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

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 1351 of file qqmljsscope.cpp.

References internalName(), and internalName().

+ Here is the call graph for this function:

◆ isScript()

bool QQmlJSScope::isScript ( ) const
inline

Definition at line 375 of file qqmljsscope_p.h.

◆ isSingleton()

bool QQmlJSScope::isSingleton ( ) const
inline

Definition at line 384 of file qqmljsscope_p.h.

Referenced by testScopeSymbol().

+ Here is the caller graph for this function:

◆ isStructured()

bool QQmlJSScope::isStructured ( ) const

Definition at line 1305 of file qqmljsscope.cpp.

References get().

+ Here is the call graph for this function:

◆ isValueType()

bool QQmlJSScope::isValueType ( ) const
inline

Definition at line 388 of file qqmljsscope_p.h.

◆ isWrappedInImplicitComponent()

bool QQmlJSScope::isWrappedInImplicitComponent ( ) const
inline

Definition at line 379 of file qqmljsscope_p.h.

◆ jsIdentifier()

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

Definition at line 293 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ listType() [1/2]

QQmlJSScope::Ptr QQmlJSScope::listType ( )
inline

Definition at line 362 of file qqmljsscope_p.h.

◆ listType() [2/2]

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

Definition at line 361 of file qqmljsscope_p.h.

Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), 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 119 of file qqmljsscope.cpp.

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

Referenced by QQmlJSTypePropagator::generate_CallProperty(), QQmlJSTypePropagator::generate_Construct(), hasMethodOrSignal(), resolveNameInQmlScope(), 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 137 of file qqmljsscope.cpp.

References QList< T >::append(), ExtensionNamespace, 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 151 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

The name of the module is only saved in the QmlComponent. Iterate through the parent scopes until the QmlComponent or the root is reached to find out the module name of the component in which this resides.

Definition at line 1020 of file qqmljsscope.cpp.

References get(), and it.

Referenced by QQmlJSImportVisitor::visit().

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

◆ mutableOwnMethodsRange()

QMultiHashRange< QString, QQmlJSMetaMethod > QQmlJSScope::mutableOwnMethodsRange ( const QString & name)
inline

Definition at line 223 of file qqmljsscope_p.h.

◆ nonCompositeBaseRevision()

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

Definition at line 1334 of file qqmljsscope.cpp.

References base.

Referenced by isRevisionAllowed().

+ Here is the caller graph for this function:

◆ nonCompositeBaseType()

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

Definition at line 629 of file qqmljsscope_p.h.

References base.

Referenced by 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 338 of file qqmljsscope_p.h.

◆ ownAttachedTypeName()

QString QQmlJSScope::ownAttachedTypeName ( ) const
inline

Definition at line 336 of file qqmljsscope_p.h.

◆ ownDefaultPropertyName()

QString QQmlJSScope::ownDefaultPropertyName ( ) const
inline

Definition at line 328 of file qqmljsscope_p.h.

◆ ownDeferredNames()

QStringList QQmlJSScope::ownDeferredNames ( ) const
inline

Definition at line 274 of file qqmljsscope_p.h.

◆ ownEnumeration()

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

Definition at line 238 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 237 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 777 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ ownImmediateNames()

QStringList QQmlJSScope::ownImmediateNames ( ) const
inline

Definition at line 276 of file qqmljsscope_p.h.

◆ ownJSIdentifier()

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

Definition at line 307 of file qqmljsscope.cpp.

References it.

Referenced by QQmlJSTypeResolver::memberType().

+ Here is the caller graph for this function:

◆ ownJSIdentifiers()

QHash< QString, QQmlJSScope::JavaScriptIdentifier > QQmlJSScope::ownJSIdentifiers ( ) const

Return all the JavaScript identifiers defined in the current scope.

Definition at line 70 of file qqmljsscope.cpp.

◆ ownMethods() [1/2]

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

Definition at line 227 of file qqmljsscope_p.h.

Referenced by QQmlJSLinter::lintModule(), QQmlJSTypeResolver::memberType(), methods(), 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 228 of file qqmljsscope_p.h.

◆ ownModuleName()

QString QQmlJSScope::ownModuleName ( ) const
inline

Definition at line 289 of file qqmljsscope_p.h.

◆ ownParentPropertyName()

QString QQmlJSScope::ownParentPropertyName ( ) const
inline

Definition at line 332 of file qqmljsscope_p.h.

◆ ownProperties()

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

Definition at line 297 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 298 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 580 of file qqmljsscope_p.h.

Referenced by createNonUniqueScopeBinding().

+ 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 585 of file qqmljsscope_p.h.

References QMultiHash< Key, T >::equal_range().

+ Here is the call graph for this function:

◆ ownPropertyBindingsInQmlIROrder()

QList< QQmlJSMetaPropertyBinding > QQmlJSScope::ownPropertyBindingsInQmlIROrder ( ) const

Definition at line 919 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ ownRuntimeFunctionIndex()

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

Definition at line 595 of file qqmljsscope_p.h.

References i, Q_ASSERT, and QList< T >::size().

+ Here is the call graph for this function:

◆ parentPropertyName()

QString QQmlJSScope::parentPropertyName ( ) const

Definition at line 1108 of file qqmljsscope.cpp.

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

+ Here is the call graph for this function:

◆ parentScope() [1/2]

QQmlJSScope::Ptr QQmlJSScope::parentScope ( )
inline

Definition at line 565 of file qqmljsscope_p.h.

References QDeferredWeakPointer< T >::toStrongRef().

Referenced by QQmlJSImportVisitor::addDefaultProperties(), clone(), collectFromAllJavaScriptParents(), createNonUniqueScopeBinding(), QQmlJSImportVisitor::endVisit(), findScopeOfSpecialItems(), insertJSIdentifier(), isComponentRootElement(), QQmlJSImportVisitor::leaveEnvironment(), QQmlJSTypeResolver::memberType(), methodFromReferrerScope(), propertyFromReferrerScope(), and reparent().

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

◆ parentScope() [2/2]

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

Definition at line 570 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 251 of file qqmljsscope.cpp.

References QString::mid().

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

+ 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 760 of file qqmljsscope.cpp.

References 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 737 of file qqmljsscope.cpp.

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

Referenced by QQmlJSUtils::changeHandlerProperty(), QQmlJSTypeResolver::consoleObject(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSTypeResolver::mathObject(), QQmlJSImportVisitor::processDefaultProperties(), QQmlJSImportVisitor::processPropertyBindings(), QQmlJSUtils::propertyFromChangedHandler(), resolve(), resolveSignalOrPropertyExpressionType(), 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 949 of file qqmljsscope.cpp.

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

Referenced by QQmlJSTypeResolver::scopedType().

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

◆ Q_FLAGS()

QQmlJSScope::Q_FLAGS ( Flags )

◆ reparent()

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

Definition at line 46 of file qqmljsscope.cpp.

References 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 QQmlJS::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 633 of file qqmljsscope.cpp.

References QString::begin(), clone(), QString::constEnd(), create(), QString::end(), QQmlSA::EnumScope, findType(), flagStorage(), QString::insert(), it, QStringLiteral, reparent(), 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 QQmlJS::ContextualTypes & contextualTypes,
QSet< QString > * usedTypes = nullptr )
static

Definition at line 705 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 671 of file qqmljsscope.cpp.

References create(), QQmlJS::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 QQmlJS::ContextualTypes & contextualTypes,
QSet< QString > * usedTypes = nullptr )
static

Definition at line 592 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 QQmlJS::ContextualTypes & contextualTypes,
QSet< QString > * usedTypes = nullptr )
static

Definition at line 578 of file qqmljsscope.cpp.

References 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 1328 of file qqmljsscope.cpp.

Referenced by QQmlSA::Element::Element(), QQmlSA::Element::accessSemantics(), attachedType(), attachedTypeName(), QQmlSA::Element::baseType(), QQmlSA::Element::baseTypeName(), canConvertForLiteralBinding(), QQmlSA::childScopesBegin(), QQmlSA::childScopesEnd(), defaultPropertyName(), QQmlSA::Element::defaultPropertyName(), enumeration(), enumerations(), QQmlSA::Element::filePath(), findCurrentQMLScope(), QQmlSA::PassManagerPrivate::findPropertyUsePasses(), hasEnumeration(), hasEnumerationKey(), hasInterface(), QQmlSA::Element::hasMethod(), hasMethod(), QQmlSA::Element::hasOwnProperty(), QQmlSA::Element::hasOwnPropertyBindings(), hasProperty(), QQmlSA::Element::hasProperty(), hasPropertyBindings(), QQmlSA::Element::hasPropertyBindings(), QQmlSA::Element::inherits(), QQmlSA::Element::internalId(), QQmlSA::Element::isComposite(), isFullyResolved(), isNameDeferred(), QQmlSA::Element::isNull(), isPropertyRequired(), QQmlSA::Element::isPropertyRequired(), jsIdentifier(), 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()

ScopeType QQmlJSScope::scopeType ( ) const
inline

◆ setAccessSemantics()

void QQmlJSScope::setAccessSemantics ( AccessSemantics semantics)
inline

Definition at line 403 of file qqmljsscope_p.h.

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

+ Here is the caller graph for this function:

◆ setAliases()

void QQmlJSScope::setAliases ( const QStringList & aliases)
inline

Definition at line 264 of file qqmljsscope_p.h.

References aliases().

+ Here is the call graph for this function:

◆ setAnnotations()

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

Definition at line 247 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 1008 of file qqmljsscope.cpp.

References baseTypeError(), and HasBaseTypeError.

+ Here is the call graph for this function:

◆ setBaseTypeName()

void QQmlJSScope::setBaseTypeName ( const QString & baseTypeName)

Definition at line 997 of file qqmljsscope.cpp.

References baseTypeName(), and HasBaseTypeError.

Referenced by 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 391 of file qqmljsscope_p.h.

◆ setExtensionIsJavaScript()

void QQmlJSScope::setExtensionIsJavaScript ( bool v)
inline

Definition at line 399 of file qqmljsscope_p.h.

◆ setExtensionIsNamespace()

void QQmlJSScope::setExtensionIsNamespace ( bool v)
inline

Definition at line 400 of file qqmljsscope_p.h.

◆ setExtensionTypeName()

void QQmlJSScope::setExtensionTypeName ( const QString & name)
inline

Definition at line 344 of file qqmljsscope_p.h.

◆ setFilePath()

void QQmlJSScope::setFilePath ( const QString & file)
inline

Definition at line 251 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 603 of file qqmljsscope_p.h.

References CustomParser.

◆ setInlineComponentName()

void QQmlJSScope::setInlineComponentName ( const QString & inlineComponentName)
inline

Definition at line 608 of file qqmljsscope_p.h.

References inlineComponentName(), isInlineComponent(), and Q_ASSERT.

Referenced by QQmlJSImportVisitor::visit().

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

◆ setInterfaceNames()

void QQmlJSScope::setInterfaceNames ( const QStringList & interfaces)
inline

Definition at line 267 of file qqmljsscope_p.h.

◆ setInternalName()

void QQmlJSScope::setInternalName ( const QString & internalName)
inline

Definition at line 256 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 396 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 393 of file qqmljsscope_p.h.

◆ setIsInlineComponent()

void QQmlJSScope::setIsInlineComponent ( bool v)
inline

Definition at line 397 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 383 of file qqmljsscope_p.h.

◆ setIsScript()

void QQmlJSScope::setIsScript ( bool v)
inline

Definition at line 394 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 390 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 398 of file qqmljsscope_p.h.

◆ setOwnAttachedTypeName()

void QQmlJSScope::setOwnAttachedTypeName ( const QString & name)
inline

Definition at line 337 of file qqmljsscope_p.h.

◆ setOwnDefaultPropertyName()

void QQmlJSScope::setOwnDefaultPropertyName ( const QString & name)
inline

Definition at line 329 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 273 of file qqmljsscope_p.h.

◆ setOwnImmediateNames()

void QQmlJSScope::setOwnImmediateNames ( const QStringList & names)
inline

Definition at line 275 of file qqmljsscope_p.h.

◆ setOwnModuleName()

void QQmlJSScope::setOwnModuleName ( const QString & moduleName)
inline

Definition at line 290 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setOwnParentPropertyName()

void QQmlJSScope::setOwnParentPropertyName ( const QString & name)
inline

Definition at line 333 of file qqmljsscope_p.h.

◆ setPropertyLocallyRequired()

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

Definition at line 794 of file qqmljsscope.cpp.

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

+ Here is the caller graph for this function:

◆ setScopeType()

void QQmlJSScope::setScopeType ( ScopeType type)
inline

Definition at line 220 of file qqmljsscope_p.h.

◆ setSourceLocation()

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

Definition at line 619 of file qqmljsscope_p.h.

References sourceLocation().

+ Here is the call graph for this function:

◆ setStructuredFlag()

void QQmlJSScope::setStructuredFlag ( bool v)
inline

Definition at line 392 of file qqmljsscope_p.h.

◆ setValueTypeName()

void QQmlJSScope::setValueTypeName ( const QString & name)
inline

Definition at line 359 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 458 of file qqmljsscope_p.h.

◆ sourceLocation()

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

Definition at line 624 of file qqmljsscope_p.h.

Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::breakInheritanceCycles(), QQmlJSLinter::lintModule(), QQmlJSImportVisitor::rootScopeIsValid(), and setSourceLocation().

+ Here is the caller graph for this function:

◆ valueType()

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

Definition at line 360 of file qqmljsscope_p.h.

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

+ Here is the caller graph for this function:

◆ valueTypeName()

QString QQmlJSScope::valueTypeName ( ) const
inline

Definition at line 358 of file qqmljsscope_p.h.

Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QTypeInfo

template<typename T >
friend class QTypeInfo
friend

Minimal information about a QQmlJSMetaPropertyBinding that allows it to be manipulated similarly to QmlIR::Binding.

Definition at line 467 of file qqmljsscope_p.h.


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