|
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 |
|
| Q_FLAGS (Flags) |
void | resetForReparse () |
QQmlJSScope::Ptr | parentScope () |
QQmlJSScope::ConstPtr | parentScope () const |
void | insertJSIdentifier (const QString &name, const JavaScriptIdentifier &identifier) |
QHash< QString, JavaScriptIdentifier > | ownJSIdentifiers () const |
void | insertPropertyIdentifier (const QQmlJSMetaProperty &prop) |
ScopeType | scopeType () const |
void | setScopeType (ScopeType type) |
void | addOwnMethod (const QQmlJSMetaMethod &method) |
QMultiHashRange< QString, QQmlJSMetaMethod > | mutableOwnMethodsRange (const QString &name) |
QMultiHash< QString, QQmlJSMetaMethod > | ownMethods () const |
QList< QQmlJSMetaMethod > | ownMethods (const QString &name) const |
bool | hasOwnMethod (const QString &name) const |
bool | hasMethod (const QString &name) const |
QHash< QString, QQmlJSMetaMethod > | methods () const |
| Returns all methods visible from this scope including those of base types and extensions.
|
QList< QQmlJSMetaMethod > | methods (const QString &name) const |
QList< QQmlJSMetaMethod > | methods (const QString &name, QQmlJSMetaMethodType type) const |
void | addOwnEnumeration (const QQmlJSMetaEnum &enumeration) |
QHash< QString, QQmlJSMetaEnum > | ownEnumerations () 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, QQmlJSMetaEnum > | enumerations () 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, QQmlJSMetaProperty > | ownProperties () 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, QQmlJSMetaProperty > | properties () 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, QQmlJSMetaPropertyBinding > | ownPropertyBindings () const |
std::pair< QMultiHash< QString, QQmlJSMetaPropertyBinding >::const_iterator, QMultiHash< QString, QQmlJSMetaPropertyBinding >::const_iterator > | ownPropertyBindings (const QString &name) const |
QList< QQmlJSMetaPropertyBinding > | ownPropertyBindingsInQmlIROrder () const |
bool | hasOwnPropertyBindings (const QString &name) const |
bool | hasPropertyBindings (const QString &name) const |
QList< QQmlJSMetaPropertyBinding > | propertyBindings (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< JavaScriptIdentifier > | jsIdentifier (const QString &id) const |
std::optional< JavaScriptIdentifier > | ownJSIdentifier (const QString &id) const |
QQmlJS::ChildScopesIterator | childScopesBegin () const |
QQmlJS::ChildScopesIterator | childScopesEnd () const |
void | setInlineComponentName (const QString &inlineComponentName) |
std::optional< QString > | inlineComponentName () const |
InlineComponentOrDocumentRootName | enclosingInlineComponentName () const |
QList< QQmlJSScope::Ptr > | childScopes () |
QList< QQmlJSScope::ConstPtr > | childScopes () 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 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::ConstPtr > | findType (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::ConstPtr & | scope (const QQmlSA::Element &) |
static constexpr qsizetype | sizeofQQmlSAElement () |
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.
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.