Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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 , JavaScriptBuiltin = 0x4 , Singleton = 0x8 ,
  Script = 0x10 , CustomParser = 0x20 , Array = 0x40 , InlineComponent = 0x80 ,
  WrappedInImplicitComponent = 0x100 , HasBaseTypeError = 0x200 , ExtensionIsNamespace = 0x400 , IsListProperty = 0x800 ,
  Structured = 0x1000 , ExtensionIsJavaScript = 0x2000 , EnforcesScopedEnums = 0x4000 , FileRootComponent = 0x8000 ,
  AssignedToUnknownProperty = 0x10000
}
enum  BindingTargetSpecifier { SimplePropertyTarget , ListPropertyTarget , UnnamedPropertyTarget }
enum class  IsComponentRoot : quint8 { No = 0 , Yes , Maybe }
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

 Q_FLAGS (Flags)
void resetForReparse ()
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)
quint32 lineNumber () const
void setLineNumber (quint32 lineNumber)
QString internalName () const
void setInternalName (const QString &internalName)
QString augmentedInternalName () const
IsComponentRoot componentRootStatus () 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
std::pair< 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 elementTypeName () const
void setElementTypeName (const QString &name)
QQmlJSScope::ConstPtr elementType () const
QQmlJSScope::ConstPtr listType () const
QQmlJSScope::Ptr listType ()
void addOwnRuntimeFunctionIndex (QQmlJSMetaMethod::AbsoluteFunctionIndex index)
QQmlJSMetaMethod::AbsoluteFunctionIndex ownRuntimeFunctionIndex (QQmlJSMetaMethod::RelativeFunctionIndex index) const
bool isComposite () const
void setIsComposite (bool v)
bool isJavaScriptBuiltin () const
void setIsJavaScriptBuiltin (bool v)
bool isScript () const
void setIsScript (bool v)
bool hasCustomParser () const
void setHasCustomParser (bool v)
bool isArrayScope () const
void setIsArrayScope (bool v)
bool isInlineComponent () const
void setIsInlineComponent (bool v)
bool isWrappedInImplicitComponent () const
void setIsWrappedInImplicitComponent (bool v)
bool isAssignedToUnknownProperty () const
void setAssignedToUnknownProperty (bool v)
bool extensionIsJavaScript () const
void setExtensionIsJavaScript (bool v)
bool extensionIsNamespace () const
void setExtensionIsNamespace (bool v)
bool isListProperty () const
void setIsListProperty (bool v)
bool isSingleton () const
void setIsSingleton (bool v)
bool enforcesScopedEnums () const
void setEnforcesScopedEnumsFlag (bool v)
bool isCreatable () const
void setCreatableFlag (bool v)
bool isStructured () const
void setStructuredFlag (bool v)
bool isFileRootComponent () const
void setIsRootFileComponentFlag (bool v)
void setAccessSemantics (AccessSemantics semantics)
AccessSemantics accessSemantics () const
bool isReferenceType () const
bool isValueType () const
std::optional< JavaScriptIdentifierjsIdentifier (const QString &id) const
std::optional< JavaScriptIdentifierownJSIdentifier (const QString &id) const
QQmlJS::ChildScopesIterator childScopesBegin () const
QQmlJS::ChildScopesIterator childScopesEnd () const
void setInlineComponentName (const QString &inlineComponentName)
std::optional< QStringinlineComponentName () const
InlineComponentOrDocumentRootName enclosingInlineComponentName () const
QList< QQmlJSScope::PtrchildScopes ()
QList< QQmlJSScope::ConstPtrchildScopes () const
void setSourceLocation (const QQmlJS::SourceLocation &sourceLocation)
QQmlJS::SourceLocation sourceLocation () const
void setIdSourceLocation (const QQmlJS::SourceLocation &sourceLocation)
QQmlJS::SourceLocation idSourceLocation () 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 clone (const QQmlJSScope::ConstPtr &origin)
static void cloneInto (QQmlJSScope::Ptr &origin, const QQmlJSScope::Ptr &target)
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 resolveGroup (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 80 of file qqmljsscope_p.h.

Member Typedef Documentation

◆ AccessSemantics

◆ ConstPtr

Definition at line 87 of file qqmljsscope_p.h.

◆ Export

Definition at line 123 of file qqmljsscope_p.h.

◆ ExportedScope

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

Definition at line 127 of file qqmljsscope_p.h.

◆ ImportedScope

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

Definition at line 125 of file qqmljsscope_p.h.

◆ InlineComponentNameType

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

◆ Ptr

◆ QMultiHashRange

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

Definition at line 152 of file qqmljsscope_p.h.

◆ RootDocumentNameType

using QQmlJSScope::RootDocumentNameType = std::monostate

Definition at line 94 of file qqmljsscope_p.h.

◆ ScopeType

Definition at line 91 of file qqmljsscope_p.h.

◆ WeakConstPtr

Definition at line 88 of file qqmljsscope_p.h.

◆ WeakPtr

Member Enumeration Documentation

◆ BindingTargetSpecifier

Enumerator
SimplePropertyTarget 
ListPropertyTarget 
UnnamedPropertyTarget 

Definition at line 145 of file qqmljsscope_p.h.

◆ ExtensionKind

Enumerator
NotExtension 
ExtensionType 
ExtensionJavaScript 
ExtensionNamespace 

Definition at line 311 of file qqmljsscope_p.h.

◆ Flag

Enumerator
Creatable 
Composite 
JavaScriptBuiltin 
Singleton 
Script 
CustomParser 
Array 
InlineComponent 
WrappedInImplicitComponent 
HasBaseTypeError 
ExtensionIsNamespace 
IsListProperty 
Structured 
ExtensionIsJavaScript 
EnforcesScopedEnums 
FileRootComponent 
AssignedToUnknownProperty 

Definition at line 101 of file qqmljsscope_p.h.

◆ IsComponentRoot

enum class QQmlJSScope::IsComponentRoot : quint8
strong
Enumerator
No 
Yes 
Maybe 

Definition at line 227 of file qqmljsscope_p.h.

Member Function Documentation

◆ accessSemantics()

AccessSemantics QQmlJSScope::accessSemantics ( ) const
inline

Definition at line 394 of file qqmljsscope_p.h.

◆ addOwnEnumeration()

void QQmlJSScope::addOwnEnumeration ( const QQmlJSMetaEnum & enumeration)
inline

Definition at line 198 of file qqmljsscope_p.h.

◆ addOwnMethod()

void QQmlJSScope::addOwnMethod ( const QQmlJSMetaMethod & method)
inline

Definition at line 184 of file qqmljsscope_p.h.

◆ addOwnProperty()

void QQmlJSScope::addOwnProperty ( const QQmlJSMetaProperty & prop)
inline

Definition at line 262 of file qqmljsscope_p.h.

◆ addOwnPropertyBinding()

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

Definition at line 856 of file qqmljsscope.cpp.

◆ addOwnRuntimeFunctionIndex()

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

Definition at line 1104 of file qqmljsscope.cpp.

◆ aliases()

QStringList QQmlJSScope::aliases ( ) const
inline

Definition at line 231 of file qqmljsscope_p.h.

◆ annotations()

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

Definition at line 210 of file qqmljsscope_p.h.

◆ attachedType()

QQmlJSScope::ConstPtr QQmlJSScope::attachedType ( ) const

Definition at line 1077 of file qqmljsscope.cpp.

◆ attachedTypeName()

QString QQmlJSScope::attachedTypeName ( ) const

Definition at line 1061 of file qqmljsscope.cpp.

◆ augmentedInternalName()

QString QQmlJSScope::augmentedInternalName ( ) const

Definition at line 222 of file qqmljsscope.cpp.

◆ baseType()

QQmlJSScope::ConstPtr QQmlJSScope::baseType ( ) const
inline

Definition at line 251 of file qqmljsscope_p.h.

◆ baseTypeError()

QString QQmlJSScope::baseTypeError ( ) const

Definition at line 1056 of file qqmljsscope.cpp.

◆ baseTypeName()

QString QQmlJSScope::baseTypeName ( ) const

Definition at line 1029 of file qqmljsscope.cpp.

◆ baseTypeRevision()

QTypeRevision QQmlJSScope::baseTypeRevision ( ) const
inline

Definition at line 252 of file qqmljsscope_p.h.

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

◆ childScopes() [1/2]

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

Definition at line 610 of file qqmljsscope_p.h.

◆ childScopes() [2/2]

QList< QQmlJSScope::ConstPtr > QQmlJSScope::childScopes ( ) const

Definition at line 1304 of file qqmljsscope.cpp.

◆ childScopesBegin()

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

Definition at line 401 of file qqmljsscope_p.h.

◆ childScopesEnd()

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

Definition at line 402 of file qqmljsscope_p.h.

◆ clearBaseType()

void QQmlJSScope::clearBaseType ( )
inline

Definition at line 258 of file qqmljsscope_p.h.

◆ clone()

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

Definition at line 49 of file qqmljsscope.cpp.

◆ cloneInto()

void QQmlJSScope::cloneInto ( QQmlJSScope::Ptr & origin,
const QQmlJSScope::Ptr & target )
inlinestatic

Definition at line 158 of file qqmljsscope_p.h.

◆ componentRootStatus()

QQmlJSScope::IsComponentRoot QQmlJSScope::componentRootStatus ( ) const

Returns Yes if the scope is the outermost element of a separate Component. Either: a, It is the root element of a QML document b, It is an inline component c, It has been implicitly wrapped, e.g. due to an assignment to a Component property d, It is the first (and only) child of a Component

Returns No if we can clearly determine that this is not the case. Returns Maybe if the scope is assigned to an unknown property. This may or may not be 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 291 of file qqmljsscope.cpp.

◆ create()

QQmlJSScope::Ptr QQmlJSScope::create ( )
inlinestatic

Definition at line 155 of file qqmljsscope_p.h.

◆ createQQmlSAElement() [1/2]

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

Definition at line 1374 of file qqmljsscope.cpp.

◆ createQQmlSAElement() [2/2]

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

Definition at line 1381 of file qqmljsscope.cpp.

◆ defaultPropertyName()

QString QQmlJSScope::defaultPropertyName ( ) const

Definition at line 1124 of file qqmljsscope.cpp.

◆ elementType()

QQmlJSScope::ConstPtr QQmlJSScope::elementType ( ) const
inline

Definition at line 326 of file qqmljsscope_p.h.

◆ elementTypeName()

QString QQmlJSScope::elementTypeName ( ) const
inline

Definition at line 324 of file qqmljsscope_p.h.

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

◆ enforcesScopedEnums()

bool QQmlJSScope::enforcesScopedEnums ( ) const

Returns true if this type or any base type of it has the "EnforcesScopedEnums" flag. The rationale is that you can turn on enforcement of scoped enums, but you cannot turn it off explicitly.

Definition at line 1320 of file qqmljsscope.cpp.

◆ enumeration()

QQmlJSMetaEnum QQmlJSScope::enumeration ( const QString & name) const

Definition at line 191 of file qqmljsscope.cpp.

◆ enumerations()

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

Definition at line 206 of file qqmljsscope.cpp.

◆ extensionIsJavaScript()

bool QQmlJSScope::extensionIsJavaScript ( ) const
inline

Definition at line 369 of file qqmljsscope_p.h.

◆ extensionIsNamespace()

bool QQmlJSScope::extensionIsNamespace ( ) const
inline

Definition at line 372 of file qqmljsscope_p.h.

◆ extensionType()

QQmlJSScope::AnnotatedScope QQmlJSScope::extensionType ( ) const

Definition at line 1093 of file qqmljsscope.cpp.

◆ extensionTypeName()

QString QQmlJSScope::extensionTypeName ( ) const
inline

Definition at line 309 of file qqmljsscope_p.h.

◆ filePath()

QString QQmlJSScope::filePath ( ) const
inline

Definition at line 212 of file qqmljsscope_p.h.

◆ findCurrentQMLScope()

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

Definition at line 745 of file qqmljsscope.cpp.

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

◆ hasCustomParser()

bool QQmlJSScope::hasCustomParser ( ) const
inline

Definition at line 354 of file qqmljsscope_p.h.

◆ hasEnumeration()

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

Definition at line 170 of file qqmljsscope.cpp.

◆ hasEnumerationKey()

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

Definition at line 185 of file qqmljsscope.cpp.

◆ hasInterface()

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

Definition at line 992 of file qqmljsscope.cpp.

◆ hasMethod()

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

Definition at line 101 of file qqmljsscope.cpp.

◆ hasOwnEnumeration()

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

Definition at line 201 of file qqmljsscope_p.h.

◆ hasOwnEnumerationKey()

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

Definition at line 176 of file qqmljsscope.cpp.

◆ hasOwnInterface()

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

Definition at line 237 of file qqmljsscope_p.h.

◆ hasOwnMethod()

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

Definition at line 191 of file qqmljsscope_p.h.

◆ hasOwnProperty()

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

Definition at line 265 of file qqmljsscope_p.h.

◆ hasOwnPropertyBindings()

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

Definition at line 591 of file qqmljsscope_p.h.

◆ hasProperty()

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

Definition at line 753 of file qqmljsscope.cpp.

◆ hasPropertyBindings()

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

Definition at line 963 of file qqmljsscope.cpp.

◆ idSourceLocation()

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

Definition at line 631 of file qqmljsscope_p.h.

◆ inherits()

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

Definition at line 1418 of file qqmljsscope.cpp.

◆ inlineComponentName()

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

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

Definition at line 1284 of file qqmljsscope.cpp.

◆ insertJSIdentifier()

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

Definition at line 69 of file qqmljsscope.cpp.

◆ insertPropertyIdentifier()

void QQmlJSScope::insertPropertyIdentifier ( const QQmlJSMetaProperty & prop)

Definition at line 91 of file qqmljsscope.cpp.

◆ interfaceNames()

QStringList QQmlJSScope::interfaceNames ( ) const
inline

Definition at line 234 of file qqmljsscope_p.h.

◆ internalName()

QString QQmlJSScope::internalName ( ) const
inline

Definition at line 220 of file qqmljsscope_p.h.

◆ isArrayScope()

bool QQmlJSScope::isArrayScope ( ) const
inline

Definition at line 357 of file qqmljsscope_p.h.

◆ isAssignedToUnknownProperty()

bool QQmlJSScope::isAssignedToUnknownProperty ( ) const
inline

Definition at line 366 of file qqmljsscope_p.h.

◆ isComposite()

bool QQmlJSScope::isComposite ( ) const
inline

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

Definition at line 340 of file qqmljsscope_p.h.

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

◆ isFileRootComponent()

bool QQmlJSScope::isFileRootComponent ( ) const
inline

Definition at line 390 of file qqmljsscope_p.h.

◆ isFullyResolved()

bool QQmlJSScope::isFullyResolved ( ) const

Definition at line 1144 of file qqmljsscope.cpp.

◆ isInCustomParserParent()

bool QQmlJSScope::isInCustomParserParent ( ) const

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

Definition at line 1269 of file qqmljsscope.cpp.

◆ isInlineComponent()

bool QQmlJSScope::isInlineComponent ( ) const
inline

Definition at line 360 of file qqmljsscope_p.h.

◆ isJavaScriptBuiltin()

bool QQmlJSScope::isJavaScriptBuiltin ( ) const
inline

Returns true for JavaScript types, false for QML and C++ types.

Definition at line 348 of file qqmljsscope_p.h.

◆ isListProperty()

bool QQmlJSScope::isListProperty ( ) const
inline

Definition at line 375 of file qqmljsscope_p.h.

◆ isNameDeferred()

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

Definition at line 1002 of file qqmljsscope.cpp.

◆ isPropertyLocallyRequired()

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

Definition at line 851 of file qqmljsscope.cpp.

◆ isPropertyRequired()

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

Definition at line 828 of file qqmljsscope.cpp.

◆ isReferenceType()

bool QQmlJSScope::isReferenceType ( ) const
inline

Definition at line 395 of file qqmljsscope_p.h.

◆ isResolved()

bool QQmlJSScope::isResolved ( ) const

Definition at line 1109 of file qqmljsscope.cpp.

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

◆ isScript()

bool QQmlJSScope::isScript ( ) const
inline

Definition at line 351 of file qqmljsscope_p.h.

◆ isSingleton()

bool QQmlJSScope::isSingleton ( ) const
inline

Definition at line 378 of file qqmljsscope_p.h.

◆ isStructured()

bool QQmlJSScope::isStructured ( ) const

Definition at line 1365 of file qqmljsscope.cpp.

◆ isValueType()

bool QQmlJSScope::isValueType ( ) const
inline

Definition at line 396 of file qqmljsscope_p.h.

◆ isWrappedInImplicitComponent()

bool QQmlJSScope::isWrappedInImplicitComponent ( ) const
inline

Definition at line 363 of file qqmljsscope_p.h.

◆ jsIdentifier()

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

Definition at line 310 of file qqmljsscope.cpp.

◆ lineNumber()

quint32 QQmlJSScope::lineNumber ( ) const
inline

Definition at line 215 of file qqmljsscope_p.h.

◆ listType() [1/2]

QQmlJSScope::Ptr QQmlJSScope::listType ( )
inline

Definition at line 328 of file qqmljsscope_p.h.

◆ listType() [2/2]

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

Definition at line 327 of file qqmljsscope_p.h.

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

◆ methods() [2/3]

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

Definition at line 138 of file qqmljsscope.cpp.

◆ methods() [3/3]

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

Definition at line 152 of file qqmljsscope.cpp.

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

◆ mutableOwnMethodsRange()

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

Definition at line 185 of file qqmljsscope_p.h.

◆ nonCompositeBaseRevision()

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

Definition at line 1394 of file qqmljsscope.cpp.

◆ nonCompositeBaseType()

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

Definition at line 637 of file qqmljsscope_p.h.

◆ ownAttachedType()

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

Definition at line 304 of file qqmljsscope_p.h.

◆ ownAttachedTypeName()

QString QQmlJSScope::ownAttachedTypeName ( ) const
inline

Definition at line 302 of file qqmljsscope_p.h.

◆ ownDefaultPropertyName()

QString QQmlJSScope::ownDefaultPropertyName ( ) const
inline

Definition at line 294 of file qqmljsscope_p.h.

◆ ownDeferredNames()

QStringList QQmlJSScope::ownDeferredNames ( ) const
inline

Definition at line 240 of file qqmljsscope_p.h.

◆ ownEnumeration()

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

Definition at line 200 of file qqmljsscope_p.h.

◆ ownEnumerations()

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

Definition at line 199 of file qqmljsscope_p.h.

◆ ownerOfProperty()

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

Definition at line 803 of file qqmljsscope.cpp.

◆ ownImmediateNames()

QStringList QQmlJSScope::ownImmediateNames ( ) const
inline

Definition at line 242 of file qqmljsscope_p.h.

◆ ownJSIdentifier()

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

Definition at line 324 of file qqmljsscope.cpp.

◆ ownJSIdentifiers()

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

Return all the JavaScript identifiers defined in the current scope.

Definition at line 64 of file qqmljsscope.cpp.

◆ ownMethods() [1/2]

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

Definition at line 189 of file qqmljsscope_p.h.

◆ ownMethods() [2/2]

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

Definition at line 190 of file qqmljsscope_p.h.

◆ ownModuleName()

QString QQmlJSScope::ownModuleName ( ) const
inline

Definition at line 255 of file qqmljsscope_p.h.

◆ ownParentPropertyName()

QString QQmlJSScope::ownParentPropertyName ( ) const
inline

Definition at line 298 of file qqmljsscope_p.h.

◆ ownProperties()

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

Definition at line 263 of file qqmljsscope_p.h.

◆ ownProperty()

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

Definition at line 264 of file qqmljsscope_p.h.

◆ ownPropertyBindings() [1/2]

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

Definition at line 581 of file qqmljsscope_p.h.

◆ ownPropertyBindings() [2/2]

std::pair< QMultiHash< QString, QQmlJSMetaPropertyBinding >::const_iterator, QMultiHash< QString, QQmlJSMetaPropertyBinding >::const_iterator > QQmlJSScope::ownPropertyBindings ( const QString & name) const
inline

Definition at line 586 of file qqmljsscope_p.h.

◆ ownPropertyBindingsInQmlIROrder()

QList< QQmlJSMetaPropertyBinding > QQmlJSScope::ownPropertyBindingsInQmlIROrder ( ) const

Definition at line 945 of file qqmljsscope.cpp.

◆ ownRuntimeFunctionIndex()

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

Definition at line 596 of file qqmljsscope_p.h.

◆ parentPropertyName()

QString QQmlJSScope::parentPropertyName ( ) const

Definition at line 1134 of file qqmljsscope.cpp.

◆ parentScope() [1/2]

QQmlJSScope::Ptr QQmlJSScope::parentScope ( )
inline

Definition at line 566 of file qqmljsscope_p.h.

◆ parentScope() [2/2]

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

Definition at line 571 of file qqmljsscope_p.h.

◆ prettyName()

QString QQmlJSScope::prettyName ( QAnyStringView name)
static

Definition at line 253 of file qqmljsscope.cpp.

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

◆ property()

QQmlJSMetaProperty QQmlJSScope::property ( const QString & name) const

Definition at line 763 of file qqmljsscope.cpp.

◆ propertyBindings()

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

Definition at line 975 of file qqmljsscope.cpp.

◆ Q_FLAGS()

QQmlJSScope::Q_FLAGS ( Flags )

◆ reparent()

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

Definition at line 40 of file qqmljsscope.cpp.

◆ resetForReparse()

void QQmlJSScope::resetForReparse ( )
inline

This should probably restricted, only needed in prepareTargetForVisit

Definition at line 165 of file qqmljsscope_p.h.

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

◆ resolveGroup()

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

Definition at line 731 of file qqmljsscope.cpp.

◆ resolveList()

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

Definition at line 695 of file qqmljsscope.cpp.

◆ resolveNonEnumTypes()

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

Definition at line 615 of file qqmljsscope.cpp.

◆ resolveTypes()

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

Definition at line 601 of file qqmljsscope.cpp.

◆ scope()

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

Definition at line 1388 of file qqmljsscope.cpp.

◆ scopeType()

ScopeType QQmlJSScope::scopeType ( ) const
inline

Definition at line 181 of file qqmljsscope_p.h.

◆ setAccessSemantics()

void QQmlJSScope::setAccessSemantics ( AccessSemantics semantics)
inline

Definition at line 393 of file qqmljsscope_p.h.

◆ setAliases()

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

Definition at line 230 of file qqmljsscope_p.h.

◆ setAnnotations()

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

Definition at line 209 of file qqmljsscope_p.h.

◆ setAssignedToUnknownProperty()

void QQmlJSScope::setAssignedToUnknownProperty ( bool v)
inline

Definition at line 367 of file qqmljsscope_p.h.

◆ setBaseTypeError()

void QQmlJSScope::setBaseTypeError ( const QString & baseTypeError)

Definition at line 1034 of file qqmljsscope.cpp.

◆ setBaseTypeName()

void QQmlJSScope::setBaseTypeName ( const QString & baseTypeName)

Definition at line 1023 of file qqmljsscope.cpp.

◆ setCreatableFlag()

void QQmlJSScope::setCreatableFlag ( bool v)
inline

Definition at line 385 of file qqmljsscope_p.h.

◆ setElementTypeName()

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

Definition at line 325 of file qqmljsscope_p.h.

◆ setEnforcesScopedEnumsFlag()

void QQmlJSScope::setEnforcesScopedEnumsFlag ( bool v)
inline

Definition at line 382 of file qqmljsscope_p.h.

◆ setExtensionIsJavaScript()

void QQmlJSScope::setExtensionIsJavaScript ( bool v)
inline

Definition at line 370 of file qqmljsscope_p.h.

◆ setExtensionIsNamespace()

void QQmlJSScope::setExtensionIsNamespace ( bool v)
inline

Definition at line 373 of file qqmljsscope_p.h.

◆ setExtensionTypeName()

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

Definition at line 310 of file qqmljsscope_p.h.

◆ setFilePath()

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

Definition at line 213 of file qqmljsscope_p.h.

◆ setHasCustomParser()

void QQmlJSScope::setHasCustomParser ( bool v)
inline

Definition at line 355 of file qqmljsscope_p.h.

◆ setIdSourceLocation()

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

Definition at line 625 of file qqmljsscope_p.h.

◆ setInlineComponentName()

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

Definition at line 604 of file qqmljsscope_p.h.

◆ setInterfaceNames()

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

Definition at line 233 of file qqmljsscope_p.h.

◆ setInternalName()

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

Definition at line 221 of file qqmljsscope_p.h.

◆ setIsArrayScope()

void QQmlJSScope::setIsArrayScope ( bool v)
inline

Definition at line 358 of file qqmljsscope_p.h.

◆ setIsComposite()

void QQmlJSScope::setIsComposite ( bool v)
inline

Definition at line 341 of file qqmljsscope_p.h.

◆ setIsInlineComponent()

void QQmlJSScope::setIsInlineComponent ( bool v)
inline

Definition at line 361 of file qqmljsscope_p.h.

◆ setIsJavaScriptBuiltin()

void QQmlJSScope::setIsJavaScriptBuiltin ( bool v)
inline

Definition at line 349 of file qqmljsscope_p.h.

◆ setIsListProperty()

void QQmlJSScope::setIsListProperty ( bool v)
inline

Definition at line 376 of file qqmljsscope_p.h.

◆ setIsRootFileComponentFlag()

void QQmlJSScope::setIsRootFileComponentFlag ( bool v)
inline

Definition at line 391 of file qqmljsscope_p.h.

◆ setIsScript()

void QQmlJSScope::setIsScript ( bool v)
inline

Definition at line 352 of file qqmljsscope_p.h.

◆ setIsSingleton()

void QQmlJSScope::setIsSingleton ( bool v)
inline

Definition at line 379 of file qqmljsscope_p.h.

◆ setIsWrappedInImplicitComponent()

void QQmlJSScope::setIsWrappedInImplicitComponent ( bool v)
inline

Definition at line 364 of file qqmljsscope_p.h.

◆ setLineNumber()

void QQmlJSScope::setLineNumber ( quint32 lineNumber)

Definition at line 84 of file qqmljsscope.cpp.

◆ setOwnAttachedTypeName()

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

Definition at line 303 of file qqmljsscope_p.h.

◆ setOwnDefaultPropertyName()

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

Definition at line 295 of file qqmljsscope_p.h.

◆ setOwnDeferredNames()

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

Definition at line 239 of file qqmljsscope_p.h.

◆ setOwnImmediateNames()

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

Definition at line 241 of file qqmljsscope_p.h.

◆ setOwnModuleName()

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

Definition at line 256 of file qqmljsscope_p.h.

◆ setOwnParentPropertyName()

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

Definition at line 299 of file qqmljsscope_p.h.

◆ setPropertyLocallyRequired()

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

Definition at line 820 of file qqmljsscope.cpp.

◆ setScopeType()

void QQmlJSScope::setScopeType ( ScopeType type)
inline

Definition at line 182 of file qqmljsscope_p.h.

◆ setSourceLocation()

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

Definition at line 615 of file qqmljsscope_p.h.

◆ setStructuredFlag()

void QQmlJSScope::setStructuredFlag ( bool v)
inline

Definition at line 388 of file qqmljsscope_p.h.

◆ sizeofQQmlSAElement()

constexpr qsizetype QQmlJSScope::sizeofQQmlSAElement ( )
inlinestaticconstexpr

Definition at line 453 of file qqmljsscope_p.h.

◆ sourceLocation()

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

Definition at line 620 of file qqmljsscope_p.h.

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


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