![]() |
Qt 6.x
The Qt SDK
|
Tracks the types for the QmlCompiler. More...
#include <qqmljsscope_p.h>
Classes | |
struct | AnnotatedScope |
struct | ContextualTypes |
class | Export |
struct | ExportedScope |
class | Import |
struct | ImportedScope |
struct | JavaScriptIdentifier |
struct | QmlIRCompatibilityBindingData |
Tracks the types for the QmlCompiler.
QQmlJSScope tracks the types used in qml for the QmlCompiler.
Multiple QQmlJSScope objects might be created for the same conceptual type, except when reused due to extensive caching. Two QQmlJSScope objects are considered equal when they are backed by the same implementation, that is, they have the same internalName. The qualifiedName of the QQmlJSScope for a type imported from multiple modules will contain the name of one of the modules that imported it, which is not unique and might change depending on the caching in .
Definition at line 97 of file qqmljsscope_p.h.
Definition at line 111 of file qqmljsscope_p.h.
using QQmlJSScope::ConstPtr = QDeferredSharedPointer<const QQmlJSScope> |
Definition at line 108 of file qqmljsscope_p.h.
Definition at line 114 of file qqmljsscope_p.h.
using QQmlJSScope::InlineComponentOrDocumentRootName = std::variant<InlineComponentNameType, RootDocumentNameType> |
A Hashable type to differentiate document roots from different inline components.
Definition at line 119 of file qqmljsscope_p.h.
Definition at line 106 of file qqmljsscope_p.h.
using QQmlJSScope::RootDocumentNameType = std::monostate |
Definition at line 115 of file qqmljsscope_p.h.
Definition at line 112 of file qqmljsscope_p.h.
using QQmlJSScope::WeakConstPtr = QDeferredWeakPointer<const QQmlJSScope> |
Definition at line 109 of file qqmljsscope_p.h.
Definition at line 107 of file qqmljsscope_p.h.
Enumerator | |
---|---|
SimplePropertyTarget | |
ListPropertyTarget | |
UnnamedPropertyTarget |
Definition at line 284 of file qqmljsscope_p.h.
Enumerator | |
---|---|
NotExtension | |
ExtensionType | |
ExtensionNamespace |
Definition at line 497 of file qqmljsscope_p.h.
enum QQmlJSScope::Flag |
Enumerator | |
---|---|
Creatable | |
Composite | |
Singleton | |
Script | |
CustomParser | |
Array | |
InlineComponent | |
WrappedInImplicitComponent | |
HasBaseTypeError | |
HasExtensionNamespace | |
IsListProperty | |
Structured |
Definition at line 122 of file qqmljsscope_p.h.
|
explicit |
Definition at line 38 of file qqmljsscope.cpp.
References QQmlJSScope(), and internalName().
Referenced by QQmlJSScope().
|
default |
|
inline |
Definition at line 572 of file qqmljsscope_p.h.
Referenced by QQmlSA::Element::accessSemantics(), QQmlJSTypeResolver::canHold(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::contentPointer(), QQmlJSCodeGenerator::contentType(), QQmlJSCodeGenerator::convertStored(), QQmlJSTypePropagator::generate_As(), QQmlJSCodeGenerator::generate_CallPropertyLookup(), QQmlJSCodeGenerator::generate_DefineArray(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSCodeGenerator::generate_GetLookup(), QQmlJSCodeGenerator::generate_LoadElement(), resolveGeneralizedGroup(), QQmlJSCodeGenerator::run(), and QQmlJSTypeResolver::valueType().
|
inline |
Definition at line 335 of file qqmljsscope_p.h.
References QQmlJSMetaEnum::name().
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 325 of file qqmljsscope_p.h.
References method.
Referenced by insertPropertyIdentifier(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 425 of file qqmljsscope_p.h.
References QQmlJSMetaProperty::propertyName().
Referenced by insertPropertyIdentifier(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 438 of file qqmljsscope_p.h.
References QQmlJS::SourceLocation::isValid(), iter, QQmlJSMetaPropertyBinding::propertyName(), Q_ASSERT, and QQmlJSMetaPropertyBinding::sourceLocation().
|
inline |
Definition at line 521 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::synthesizeCompilationUnitRuntimeFunctionIndices().
|
inline |
Definition at line 346 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::checkDeprecation().
QQmlJSScope::ConstPtr QQmlJSScope::attachedType | ( | ) | const |
Definition at line 1057 of file qqmljsscope.cpp.
References QDeferredSharedPointer< T >::isNull(), NotExtension, ownAttachedType(), ptr(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSLinter::lintModule(), and QQmlJSTypeResolver::memberType().
QString QQmlJSScope::attachedTypeName | ( | ) | const |
Definition at line 1041 of file qqmljsscope.cpp.
References QDeferredSharedPointer< T >::isNull(), NotExtension, ownAttachedType(), ownAttachedTypeName(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
|
inline |
Definition at line 355 of file qqmljsscope_p.h.
References base.
Referenced by QQmlJSCodeGenerator::AccumulatorConverter::AccumulatorConverter(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), and QQmlJSCodeGenerator::run().
|
inline |
Definition at line 410 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlSA::Element::baseType(), QQmlJSImportVisitor::breakInheritanceCycles(), canAssign(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSImportVisitor::checkDeprecation(), QQmlJSImportVisitor::checkRequiredProperties(), QQmlJSCodeGenerator::contentType(), QQmlJSTypeResolver::genericType(), QQmlJSUtils::hasCompositeBase(), inherits(), isCreatable(), isInCustomParserParent(), isResolved(), isRevisionAllowed(), isStructured(), mayBeUnresolvedGeneralizedGroupedProperty(), QQmlJSTypeResolver::merge(), QQmlJSImportVisitor::processDefaultProperties(), qFindInlineComponents(), resolveGeneralizedGroup(), and QQmlJSImportVisitor::visit().
QString QQmlJSScope::baseTypeError | ( | ) | const |
Definition at line 1036 of file qqmljsscope.cpp.
References HasBaseTypeError.
Referenced by QQmlJSImportVisitor::breakInheritanceCycles(), and setBaseTypeError().
QString QQmlJSScope::baseTypeName | ( | ) | const |
Definition at line 1025 of file qqmljsscope.cpp.
References HasBaseTypeError.
Referenced by QQmlSA::Element::baseTypeName(), QQmlJSImportVisitor::breakInheritanceCycles(), QQmlJSImportVisitor::endVisit(), getScopeName(), setBaseTypeName(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 411 of file qqmljsscope_p.h.
Referenced by isRevisionAllowed().
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.
true
in this case. In addition any "QObject" based derived type can be assigned to a this type if that type is derived from "QQmlComponent". Definition at line 1179 of file qqmljsscope.cpp.
References baseType(), canAssign(), derived, QDuplicateTracker< T, Prealloc >::hasSeen(), internalName(), isComposite(), isListProperty(), QDeferredSharedPointer< T >::isNull(), isSameType(), nonCompositeBaseType(), Q_ASSERT, scope(), and valueType().
Referenced by canAssign().
|
static |
Returns if assigning assignedType to property would require an implicit component wrapping.
Definition at line 234 of file qqmljsscope.cpp.
References nonCompositeBaseType(), and Q_ASSERT.
Referenced by QQmlJSImportVisitor::processDefaultProperties(), and QQmlJSImportVisitor::processPropertyBindingObjects().
|
inline |
Definition at line 594 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::checkGroupedAndAttachedScopes(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::enterEnvironmentNonUnique(), qFindInlineComponents(), and QQmlJSUtils::traverseFollowingQmlIrObjectStructure().
|
inline |
Definition at line 599 of file qqmljsscope_p.h.
References child.
|
inline |
Definition at line 583 of file qqmljsscope_p.h.
Referenced by QQmlSA::Element::childScopesBegin().
|
inline |
Definition at line 584 of file qqmljsscope_p.h.
Referenced by QQmlSA::Element::childScopesEnd().
|
inline |
Definition at line 421 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::breakInheritanceCycles().
|
static |
Definition at line 52 of file qqmljsscope.cpp.
References create(), QDeferredSharedPointer< T >::isNull(), parent, and parentScope().
Referenced by QQmlJSTypeResolver::adjustOriginalType(), QQmlJSTypeResolver::adjustTrackedType(), QQmlJSTypeResolver::adjustTrackedType(), QQmlJSTypeResolver::generalizeType(), resolveEnums(), QQmlJSTypeResolver::trackedType(), and QQmlJSImportVisitor::visit().
|
inlinestatic |
Definition at line 290 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), clone(), QQmlJSImportVisitor::enterEnvironment(), QQmlJSLinter::lintFile(), resolveEnums(), resolveList(), and QQmlJSAotCompiler::setDocument().
|
inlinestatic |
Definition at line 291 of file qqmljsscope_p.h.
References internalName().
|
static |
Definition at line 1298 of file qqmljsscope.cpp.
References ptr().
Referenced by QQmlSA::PassManagerPrivate::analyze(), QQmlSA::Binding::attachingType(), QQmlSA::Element::baseType(), QQmlJSTypePropagator::generate_CallProperty(), QQmlJSTypePropagator::generate_LoadQmlContextPropertyLookup(), QQmlJSTypePropagator::generate_Ret(), QQmlJSTypePropagator::generate_StoreNameCommon(), QQmlJSTypePropagator::generate_StoreProperty(), QQmlSA::Binding::groupType(), QQmlJSLinter::lintFile(), QQmlSA::Binding::literalType(), QQmlSA::Binding::objectType(), QQmlSA::Element::parentScope(), QQmlSA::PassManagerPrivate::registerPropertyPass(), QQmlSA::GenericPass::resolveAttached(), QQmlSA::GenericPass::resolveAttachedInFileScope(), QQmlSA::GenericPass::resolveBuiltinType(), QQmlSA::GenericPass::resolveIdToElement(), QQmlSA::GenericPass::resolveType(), and QQmlSA::GenericPass::resolveTypeInFileScope().
|
static |
Definition at line 1305 of file qqmljsscope.cpp.
References ptr().
QString QQmlJSScope::defaultPropertyName | ( | ) | const |
Definition at line 1088 of file qqmljsscope.cpp.
References QString::isEmpty(), ownDefaultPropertyName(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlSA::Element::defaultPropertyName(), and QQmlJSImportVisitor::processDefaultProperties().
QQmlJSScope::InlineComponentOrDocumentRootName QQmlJSScope::enclosingInlineComponentName | ( | ) | const |
If this type is part of an inline component, return its name. Otherwise, if this type is part of the document root, return the document root name.
Definition at line 1244 of file qqmljsscope.cpp.
References get().
QQmlJSMetaEnum QQmlJSScope::enumeration | ( | const QString & | name | ) | const |
Definition at line 178 of file qqmljsscope.cpp.
References QHash< Key, T >::end(), QHash< Key, T >::find(), it, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
QHash< QString, QQmlJSMetaEnum > QQmlJSScope::enumerations | ( | ) | const |
Definition at line 193 of file qqmljsscope.cpp.
References QHash< Key, T >::constBegin(), QHash< Key, T >::constEnd(), QListSpecialMethodsBase< T >::contains(), QList< T >::insert(), it, results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
|
inline |
Definition at line 553 of file qqmljsscope_p.h.
|
inline |
Definition at line 507 of file qqmljsscope_p.h.
Referenced by QQmlJSCodeGenerator::convertContained(), QQmlJSCodeGenerator::convertStored(), and QQmlJSCodeGenerator::generate_DefineObjectLiteral().
|
inline |
Definition at line 495 of file qqmljsscope_p.h.
|
inline |
Definition at line 348 of file qqmljsscope_p.h.
Referenced by QQmlJSRegisterContent::descriptiveName(), and QQmlSA::Element::filePath().
|
static |
Definition at line 741 of file qqmljsscope.cpp.
References parentScope(), QQmlSA::QMLScope, and scope().
Referenced by isIdInCurrentQmlScopes(), and QQmlJSTypeResolver::scopedType().
std::optional< QQmlJSScope::JavaScriptIdentifier > QQmlJSScope::findJSIdentifier | ( | const QString & | id | ) | const |
Definition at line 323 of file qqmljsscope.cpp.
References it, QQmlSA::JSFunctionScope, QQmlSA::JSLexicalScope, parentScope(), and scope().
Referenced by isIdInjectedFromSignal(), and QQmlJSTypeResolver::memberType().
|
static |
Finds a type in contextualTypes with given name. If a type is found, then its name is inserted into usedTypes (when provided). If contextualTypes has mode INTERNAl, then namespace resolution for enums is done (eg for Qt::Alignment). If contextualTypes has mode QML, then inline component resolution is done ("qmlFileName.IC" is correctly resolved from qmlFileName).
Definition at line 383 of file qqmljsscope.cpp.
References QQmlJSScope::ContextualTypes::context(), findType(), QSet< T >::insert(), QQmlJSScope::ContextualTypes::INTERNAL, isReferenceType(), QString::left(), QString::length(), listType(), QString::mid(), qFindInlineComponents(), QQmlJSScope::ContextualTypes::QML, QStringLiteral, QQmlJSScope::ImportedScope< Pointer >::revision, QQmlJSScope::ImportedScope< Pointer >::scope, and QQmlJSScope::ContextualTypes::types().
Referenced by findType(), QQmlJSImportVisitor::processPropertyTypes(), and resolveEnums().
|
inline |
Definition at line 537 of file qqmljsscope_p.h.
Referenced by isCreatable().
|
inline |
Definition at line 549 of file qqmljsscope_p.h.
Referenced by isInCustomParserParent().
bool QQmlJSScope::hasEnumeration | ( | const QString & | name | ) | const |
Definition at line 161 of file qqmljsscope.cpp.
References QHash< Key, T >::contains(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
bool QQmlJSScope::hasEnumerationKey | ( | const QString & | name | ) | const |
Definition at line 167 of file qqmljsscope.cpp.
References e, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
bool QQmlJSScope::hasInterface | ( | const QString & | name | ) | const |
Definition at line 972 of file qqmljsscope.cpp.
References NotExtension, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSImportVisitor::endVisit(), and QQmlJSImportVisitor::processPropertyBindingObjects().
bool QQmlJSScope::hasMethod | ( | const QString & | name | ) | const |
Definition at line 92 of file qqmljsscope.cpp.
References QMultiHash< Key, T >::contains(), ExtensionNamespace, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlSA::Element::hasMethod().
|
inline |
Definition at line 338 of file qqmljsscope_p.h.
|
inline |
Definition at line 396 of file qqmljsscope_p.h.
|
inline |
Definition at line 328 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::memberType(), and QQmlJSTypeResolver::scopedType().
|
inline |
Definition at line 428 of file qqmljsscope_p.h.
Referenced by QQmlJSTypePropagator::generate_StoreNameCommon(), isPropertyRequired(), QQmlJSTypeResolver::memberType(), ownerOfProperty(), and QQmlJSTypeResolver::scopedType().
|
inline |
Definition at line 466 of file qqmljsscope_p.h.
Referenced by QQmlSA::Element::hasOwnPropertyBindings(), hasPropertyBindings(), and propertyBindings().
bool QQmlJSScope::hasProperty | ( | const QString & | name | ) | const |
Definition at line 749 of file qqmljsscope.cpp.
References QHash< Key, T >::contains(), ExtensionNamespace, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlSA::Element::hasProperty(), QQmlJSImportVisitor::processPropertyBindings(), QQmlJSFunctionInitializer::run(), and QQmlJSImportVisitor::visit().
bool QQmlJSScope::hasPropertyBindings | ( | const QString & | name | ) | const |
Definition at line 943 of file qqmljsscope.cpp.
References hasOwnPropertyBindings(), NotExtension, Q_ASSERT, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlSA::Element::hasPropertyBindings().
|
inline |
Definition at line 540 of file qqmljsscope_p.h.
Referenced by isStructured().
|
inline |
Definition at line 667 of file qqmljsscope_p.h.
References base, baseType(), and get().
Referenced by QQmlSA::Element::inherits().
std::optional< QString > QQmlJSScope::inlineComponentName | ( | ) | const |
if this->isInlineComponent(), then this getter returns the name of the inline component.
Definition at line 1233 of file qqmljsscope.cpp.
References isInlineComponent(), and Q_ASSERT.
Referenced by qFindInlineComponents(), and QQmlJSImportVisitor::visit().
void QQmlJSScope::insertJSIdentifier | ( | const QString & | name, |
const JavaScriptIdentifier & | identifier | ||
) |
Definition at line 63 of file qqmljsscope.cpp.
References QQmlJSScope::JavaScriptIdentifier::Injected, QQmlSA::JSFunctionScope, QQmlJSScope::JavaScriptIdentifier::kind, QQmlJSScope::JavaScriptIdentifier::LexicalScoped, parentScope(), Q_ASSERT, and QQmlSA::QMLScope.
Referenced by QQmlJSImportVisitor::flushPendingSignalParameters(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().
void QQmlJSScope::insertPropertyIdentifier | ( | const QQmlJSMetaProperty & | prop | ) |
Definition at line 78 of file qqmljsscope.cpp.
References addOwnMethod(), addOwnProperty(), method, and property.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 393 of file qqmljsscope_p.h.
|
inline |
Definition at line 353 of file qqmljsscope_p.h.
Referenced by QQmlJSScope(), adjustErrorMessage(), adjustErrorMessage(), QQmlJSImportVisitor::breakInheritanceCycles(), canAssign(), QQmlJSTypeResolver::canConvertFromTo(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSImportVisitor::checkDeprecation(), QQmlJSCodeGenerator::conversion(), QQmlJSCodeGenerator::convertContained(), QQmlJSCodeGenerator::convertStored(), QQmlJSRegisterContent::descriptiveName(), QQmlJSCodeGenerator::generate_DefineArray(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSCodeGenerator::generate_SetLookup(), QQmlJSCodeGenerator::generateEnumLookup(), getScopeName(), QQmlSA::Element::internalId(), internalName(), isSameType(), QQmlJSLinter::lintModule(), QQmlSA::lookupName(), QQmlJSCodeGenerator::metaObject(), QQmlSA::Element::name(), QQmlSA::DebugPropertyPass::onBinding(), QQmlSA::DebugPropertyPass::onRead(), QQmlSA::DebugPropertyPass::onWrite(), and QQmlJSCodeGenerator::run().
|
inline |
Definition at line 550 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::addDefaultProperties(), and QQmlJSUtils::traverseFollowingQmlIrObjectStructure().
bool QQmlJSScope::isComponentRootElement | ( | ) | const |
Returns true if the scope is the outermost element of a separate Component Either because it has been implicitly wrapped, e.g. due to an assignment to a Component property, or because it is the first (and only) child of a Component. For visitors: This method should only be called after implicit components are detected, that is, after QQmlJSImportVisitor::endVisit(UiProgram *) was called.
Definition at line 281 of file qqmljsscope.cpp.
References base, nonCompositeBaseType(), parentScope(), and WrappedInImplicitComponent.
|
inline |
Returns true for objects defined from Qml, and false for objects declared from C++.
Definition at line 547 of file qqmljsscope_p.h.
Referenced by canAssign(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_As(), QQmlJSTypePropagator::generate_As(), QQmlJSCodeGenerator::generateEnumLookup(), QQmlSA::Element::isComposite(), isComposite(), isCreatable(), isResolved(), isRevisionAllowed(), isStructured(), QQmlSA::lookupName(), QQmlJSCodeGenerator::metaObject(), and QQmlJSImportVisitor::visit().
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
Definition at line 1268 of file qqmljsscope.cpp.
References baseType(), QDeferredSharedPointer< T >::get(), hasCreatableFlag(), isComposite(), isSingleton(), QQmlSA::QMLScope, scope(), and scopeType().
bool QQmlJSScope::isFullyResolved | ( | ) | const |
Definition at line 1108 of file qqmljsscope.cpp.
References isResolved(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSLinter::lintModule(), and QQmlJSImportVisitor::visit().
bool QQmlJSScope::isIdInCurrentJSScopes | ( | const QString & | id | ) | const |
Definition at line 302 of file qqmljsscope.cpp.
References parentScope(), and QQmlSA::QMLScope.
Referenced by isIdInCurrentScope().
bool QQmlJSScope::isIdInCurrentQmlScopes | ( | const QString & | id | ) | const |
Definition at line 291 of file qqmljsscope.cpp.
References QHash< Key, T >::contains(), QMultiHash< Key, T >::contains(), findCurrentQMLScope(), parentScope(), and QQmlSA::QMLScope.
Referenced by isIdInCurrentScope().
bool QQmlJSScope::isIdInCurrentScope | ( | const QString & | id | ) | const |
Definition at line 87 of file qqmljsscope.cpp.
References isIdInCurrentJSScopes(), and isIdInCurrentQmlScopes().
bool QQmlJSScope::isIdInjectedFromSignal | ( | const QString & | id | ) | const |
Definition at line 316 of file qqmljsscope.cpp.
References findJSIdentifier(), and QQmlJSScope::JavaScriptIdentifier::Injected.
bool QQmlJSScope::isInCustomParserParent | ( | ) | const |
Checks whether this type or its parents have a custom parser.
Definition at line 1218 of file qqmljsscope.cpp.
References baseType(), get(), hasCustomParser(), QDeferredSharedPointer< T >::isNull(), parentScope(), and scope().
Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::checkGroupedAndAttachedScopes(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::processDefaultProperties(), and QQmlJSImportVisitor::processPropertyBindings().
|
inline |
Definition at line 551 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::checkRequiredProperties(), inlineComponentName(), and qFindInlineComponents().
|
inline |
Definition at line 568 of file qqmljsscope_p.h.
Referenced by canAssign(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::contentPointer(), QQmlJSCodeGenerator::contentType(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_DefineArray(), QQmlJSCodeGenerator::generate_GetLookup(), and QQmlJSCodeGenerator::generate_SetLookup().
bool QQmlJSScope::isNameDeferred | ( | const QString & | name | ) | const |
Definition at line 982 of file qqmljsscope.cpp.
References ownDeferredNames(), ownImmediateNames(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSImportVisitor::endVisit(), and QQmlJSFunctionInitializer::run().
bool QQmlJSScope::isPropertyLocallyRequired | ( | const QString & | name | ) | const |
Definition at line 847 of file qqmljsscope.cpp.
Referenced by isPropertyRequired().
bool QQmlJSScope::isPropertyRequired | ( | const QString & | name | ) | const |
Definition at line 824 of file qqmljsscope.cpp.
References ExtensionNamespace, hasOwnProperty(), if(), isPropertyLocallyRequired(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlSA::Element::isPropertyRequired().
|
inline |
Definition at line 573 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::canHold(), QQmlJSCodeGenerator::conversion(), QQmlJSCodeGenerator::conversion(), QQmlJSCodeGenerator::convertContained(), QQmlJSCodeGenerator::convertStored(), findType(), QQmlJSCodeGenerator::generate_As(), QQmlJSTypePropagator::generate_CallProperty(), QQmlJSCodeGenerator::generate_GetLookup(), and QQmlJSTypePropagator::generate_LoadQmlContextPropertyLookup().
bool QQmlJSScope::isResolved | ( | ) | const |
Definition at line 1073 of file qqmljsscope.cpp.
References baseType(), isComposite(), QString::isEmpty(), and nonCompositeBaseType().
Referenced by isFullyResolved().
|
inline |
Checks whether otherScope is the same type as this.
In addition to checking whether the scopes are identical, we also cover duplicate scopes with the same internal name.
Definition at line 660 of file qqmljsscope_p.h.
References QDeferredSharedPointer< T >::get(), internalName(), internalName(), and QString::isEmpty().
Referenced by canAssign().
|
inline |
Definition at line 548 of file qqmljsscope_p.h.
|
inline |
Definition at line 534 of file qqmljsscope_p.h.
Referenced by isCreatable().
bool QQmlJSScope::isStructured | ( | ) | const |
Definition at line 1289 of file qqmljsscope.cpp.
References baseType(), get(), hasStructuredFlag(), isComposite(), and scope().
|
inline |
Definition at line 574 of file qqmljsscope_p.h.
|
inline |
Definition at line 552 of file qqmljsscope_p.h.
std::optional< QQmlJSScope::JavaScriptIdentifier > QQmlJSScope::JSIdentifier | ( | const QString & | id | ) | const |
Definition at line 337 of file qqmljsscope.cpp.
References it.
|
inline |
Definition at line 519 of file qqmljsscope_p.h.
|
inline |
Definition at line 518 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::areEquivalentLists(), findType(), and resolveList().
QHash< QString, QQmlJSMetaMethod > QQmlJSScope::methods | ( | ) | const |
Returns all methods visible from this scope including those of base types and extensions.
Definition at line 111 of file qqmljsscope.cpp.
References QMultiHash< Key, T >::constBegin(), QMultiHash< Key, T >::constEnd(), QListSpecialMethodsBase< T >::contains(), ExtensionNamespace, QList< T >::insert(), it, results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSFunctionInitializer::run(), and QQmlJSImportVisitor::visit().
QList< QQmlJSMetaMethod > QQmlJSScope::methods | ( | const QString & | name | ) | const |
Definition at line 129 of file qqmljsscope.cpp.
References QList< T >::append(), ExtensionNamespace, ownMethods(), results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
QList< QQmlJSMetaMethod > QQmlJSScope::methods | ( | const QString & | name, |
QQmlJSMetaMethodType | type | ||
) | const |
Definition at line 143 of file qqmljsscope.cpp.
References QList< T >::append(), ExtensionNamespace, method, ownMethods(), results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
|
inline |
Definition at line 418 of file qqmljsscope_p.h.
Referenced by qualifiedNameFrom().
|
inlinestatic |
Definition at line 643 of file qqmljsscope_p.h.
References base.
Referenced by isRevisionAllowed().
|
inlinestatic |
Definition at line 634 of file qqmljsscope_p.h.
References base.
Referenced by canAssign(), causesImplicitComponentWrapping(), QQmlJSCodeGenerator::contentType(), isComponentRootElement(), isResolved(), and QQmlJSTypeResolver::storedType().
|
default |
|
inline |
Definition at line 490 of file qqmljsscope_p.h.
Referenced by attachedType(), and attachedTypeName().
|
inline |
Definition at line 488 of file qqmljsscope_p.h.
Referenced by attachedTypeName().
|
inline |
Definition at line 480 of file qqmljsscope_p.h.
Referenced by defaultPropertyName().
|
inline |
Definition at line 399 of file qqmljsscope_p.h.
Referenced by isNameDeferred().
|
inline |
Definition at line 337 of file qqmljsscope_p.h.
References QQmlJSMetaEnum::value().
|
inline |
Definition at line 336 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::checkEnums().
|
static |
Definition at line 799 of file qqmljsscope.cpp.
References ExtensionNamespace, hasOwnProperty(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
|
inline |
Definition at line 401 of file qqmljsscope_p.h.
Referenced by isNameDeferred().
|
inline |
Definition at line 326 of file qqmljsscope_p.h.
Referenced by QQmlJSLinter::lintModule(), QQmlJSTypeResolver::memberType(), methods(), methods(), QQmlSA::Element::ownMethods(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 327 of file qqmljsscope_p.h.
|
inline |
Definition at line 484 of file qqmljsscope_p.h.
Referenced by parentPropertyName().
|
inline |
Definition at line 426 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::checkRequiredProperties(), QQmlJSLinter::lintModule(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 427 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::memberType().
|
inline |
Definition at line 455 of file qqmljsscope_p.h.
Referenced by createNonUniqueScopeBinding(), QQmlSA::Element::ownPropertyBindings(), QQmlSA::Element::ownPropertyBindings(), and propertyBindings().
|
inline |
Definition at line 461 of file qqmljsscope_p.h.
QList< QQmlJSMetaPropertyBinding > QQmlJSScope::ownPropertyBindingsInQmlIROrder | ( | ) | const |
Definition at line 925 of file qqmljsscope.cpp.
References QList< T >::append(), QMultiHash< Key, T >::equal_range(), Q_ASSERT, and QList< T >::reserve().
|
inline |
Definition at line 526 of file qqmljsscope_p.h.
QString QQmlJSScope::parentPropertyName | ( | ) | const |
Definition at line 1098 of file qqmljsscope.cpp.
References QString::isEmpty(), ownParentPropertyName(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
|
inline |
Definition at line 298 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::addDefaultProperties(), clone(), createNonUniqueScopeBinding(), QQmlJSImportVisitor::endVisit(), findCurrentQMLScope(), findJSIdentifier(), findMethodIn(), findPropertyIn(), insertJSIdentifier(), isComponentRootElement(), isIdInCurrentJSScopes(), isIdInCurrentQmlScopes(), isInCustomParserParent(), QQmlJSImportVisitor::leaveEnvironment(), QQmlSA::Element::parentScope(), and reparent().
|
inline |
Definition at line 303 of file qqmljsscope_p.h.
References QT_WARNING_DISABLE_GCC, QT_WARNING_POP, QT_WARNING_PUSH, and QDeferredWeakPointer< T >::toStrongRef().
|
static |
Definition at line 209 of file qqmljsscope.cpp.
References QString::mid(), QString::size(), and QString::startsWith().
Referenced by QQmlSA::Element::baseTypeName(), QQmlJSTypeResolver::containedTypeName(), QQmlSA::Element::name(), and QQmlJSLiteralBindingCheck::run().
QHash< QString, QQmlJSMetaProperty > QQmlJSScope::properties | ( | ) | const |
Returns all properties visible from this scope including those of base types and extensions.
Definition at line 782 of file qqmljsscope.cpp.
References QHash< Key, T >::constBegin(), QHash< Key, T >::constEnd(), QListSpecialMethodsBase< T >::contains(), ExtensionNamespace, QList< T >::insert(), it, results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
QQmlJSMetaProperty QQmlJSScope::property | ( | const QString & | name | ) | const |
Definition at line 759 of file qqmljsscope.cpp.
References QHash< Key, T >::end(), ExtensionNamespace, QHash< Key, T >::find(), it, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSUtils::changeHandlerProperty(), QQmlJSTypePropagator::generate_CallProperty(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSImportVisitor::processDefaultProperties(), QQmlJSImportVisitor::processPropertyBindings(), QQmlSA::Element::property(), resolveAlias(), and QQmlJSFunctionInitializer::run().
QList< QQmlJSMetaPropertyBinding > QQmlJSScope::propertyBindings | ( | const QString & | name | ) | const |
Definition at line 955 of file qqmljsscope.cpp.
References QList< T >::append(), hasOwnPropertyBindings(), it, NotExtension, ownPropertyBindings(), Q_ASSERT, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlSA::Element::propertyBindings().
QQmlJSScope::Q_FLAGS | ( | Flags | ) |
|
inline |
Definition at line 413 of file qqmljsscope_p.h.
Referenced by qualifiedNameFrom().
|
static |
Definition at line 1003 of file qqmljsscope.cpp.
References QString::arg(), arg, QTypeRevision::hasMajorVersion(), QTypeRevision::hasMinorVersion(), QTypeRevision::majorVersion(), QTypeRevision::minorVersion(), moduleName(), qualifiedName(), and typeName.
|
static |
Definition at line 43 of file qqmljsscope.cpp.
References parent, parentScope(), and QDeferredWeakPointer< T >::toStrongRef().
Referenced by QQmlJSImportVisitor::enterEnvironment(), and resolveEnums().
|
static |
Resolves all enums of self.
Some enums happen to have an alias, e.g. when an enum is used as a flag, the enum will exist in two versions, once as enum (e.g. Qt::MouseButton) and once as a flag (e.g. Qt::MouseButtons). In this case, normally only the flag is exposed to the qt metatype system and tools like qmltc will have troubles when encountering the enum in signal parameters etc. To solve this problem, resolveEnums() will create a QQmlJSMetaEnum copy for the alias in case the 'self'-scope already does not have an enum called like the alias.
Definition at line 655 of file qqmljsscope.cpp.
References QString::begin(), clone(), QString::constEnd(), create(), QString::end(), QQmlSA::EnumScope, findType(), flagStorage(), QHash< Key, T >::insert(), QString::insert(), it, QStringLiteral, reparent(), setBaseTypeName(), QQmlJSMetaEnum::setType(), and typeName.
Referenced by resolveTypes().
|
static |
Definition at line 727 of file qqmljsscope.cpp.
References accessSemantics(), baseType(), Q_ASSERT, and resolveNonEnumTypes().
|
static |
Definition at line 693 of file qqmljsscope.cpp.
References create(), QQmlJSScope::ContextualTypes::INTERNAL, QDeferredSharedPointer< T >::isNull(), listType(), Q_ASSERT, resolveTypes(), setAccessSemantics(), setFilePath(), setInternalName(), setValueTypeName(), and valueType().
Referenced by resolveTypes().
|
static |
Definition at line 614 of file qqmljsscope.cpp.
References resolveTypesInternal().
Referenced by resolveGeneralizedGroup().
|
static |
Definition at line 600 of file qqmljsscope.cpp.
References QQmlJSScope::ContextualTypes::arrayType(), resolveEnums(), resolveList(), and resolveTypesInternal().
Referenced by QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), resolveList(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().
|
static |
Definition at line 1312 of file qqmljsscope.cpp.
Referenced by QQmlSA::Element::Element(), QQmlSA::Element::accessSemantics(), attachedType(), attachedTypeName(), QQmlSA::Element::baseType(), QQmlSA::Element::baseTypeName(), canAssign(), QQmlSA::Element::childScopesBegin(), QQmlSA::Element::childScopesEnd(), defaultPropertyName(), QQmlSA::Element::defaultPropertyName(), enumeration(), enumerations(), QQmlSA::Element::filePath(), findCurrentQMLScope(), findJSIdentifier(), hasEnumeration(), hasEnumerationKey(), hasInterface(), QQmlSA::Element::hasMethod(), hasMethod(), QQmlSA::Element::hasOwnPropertyBindings(), hasProperty(), QQmlSA::Element::hasProperty(), hasPropertyBindings(), QQmlSA::Element::hasPropertyBindings(), QQmlSA::Element::inherits(), QQmlSA::Element::internalId(), QQmlSA::Element::isComposite(), isCreatable(), isFullyResolved(), isInCustomParserParent(), isNameDeferred(), QQmlSA::Element::isNull(), isPropertyRequired(), QQmlSA::Element::isPropertyRequired(), isStructured(), QQmlSA::lookupName(), methods(), methods(), methods(), QQmlSA::Element::name(), QQmlSA::DebugPropertyPass::onBinding(), QQmlSA::DebugPropertyPass::onRead(), QQmlSA::DebugPropertyPass::onWrite(), QQmlSA::Element::operator bool(), QQmlSA::Element::operator!(), QQmlSA::Element::operator=(), ownerOfProperty(), QQmlSA::Element::ownMethods(), QQmlSA::Element::ownPropertyBindings(), QQmlSA::Element::ownPropertyBindings(), parentPropertyName(), QQmlSA::Element::parentScope(), properties(), property(), QQmlSA::Element::property(), propertyBindings(), QQmlSA::Element::propertyBindings(), QQmlSA::GenericPass::resolveAttached(), QQmlSA::GenericPass::resolveAttachedInFileScope(), QQmlSA::GenericPass::resolveElementToId(), QQmlSA::GenericPass::resolveIdToElement(), QQmlSA::Element::scopeType(), and QQmlSA::Element::sourceLocation().
|
inline |
Definition at line 322 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::contentPointer(), QQmlJSCodeGenerator::contentType(), createNonUniqueScopeBinding(), QQmlJSImportVisitor::endVisit(), isCreatable(), mayBeUnresolvedGeneralizedGroupedProperty(), QQmlSA::Element::scopeType(), QQmlJSImportVisitor::synthesizeCompilationUnitRuntimeFunctionIndices(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 571 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), and resolveList().
|
inline |
Definition at line 345 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit().
Definition at line 1030 of file qqmljsscope.cpp.
References baseTypeError(), and HasBaseTypeError.
Referenced by QQmlJSImportVisitor::breakInheritanceCycles().
Definition at line 1019 of file qqmljsscope.cpp.
References baseTypeName(), and HasBaseTypeError.
Referenced by resolveEnums(), and setScopeName().
|
inline |
Definition at line 555 of file qqmljsscope_p.h.
|
inline |
Definition at line 566 of file qqmljsscope_p.h.
Definition at line 496 of file qqmljsscope_p.h.
Definition at line 349 of file qqmljsscope_p.h.
References file.
Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), and resolveList().
|
inline |
Definition at line 559 of file qqmljsscope_p.h.
Definition at line 586 of file qqmljsscope_p.h.
References Q_ASSERT.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 392 of file qqmljsscope_p.h.
Definition at line 354 of file qqmljsscope_p.h.
References internalName().
Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), resolveList(), and setScopeName().
|
inline |
Definition at line 563 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 557 of file qqmljsscope_p.h.
|
inline |
Definition at line 564 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 569 of file qqmljsscope_p.h.
|
inline |
Definition at line 558 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 554 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 565 of file qqmljsscope_p.h.
Definition at line 419 of file qqmljsscope_p.h.
Definition at line 489 of file qqmljsscope_p.h.
Definition at line 481 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 398 of file qqmljsscope_p.h.
|
inline |
Definition at line 400 of file qqmljsscope_p.h.
Definition at line 485 of file qqmljsscope_p.h.
Definition at line 816 of file qqmljsscope.cpp.
Referenced by QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().
Definition at line 414 of file qqmljsscope_p.h.
Definition at line 323 of file qqmljsscope_p.h.
|
inline |
Definition at line 624 of file qqmljsscope_p.h.
|
inline |
Definition at line 556 of file qqmljsscope_p.h.
Definition at line 516 of file qqmljsscope_p.h.
Referenced by resolveList().
|
inlinestaticconstexpr |
Definition at line 724 of file qqmljsscope_p.h.
|
inline |
Definition at line 629 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::breakInheritanceCycles(), QQmlJSImportVisitor::checkDeprecation(), QQmlLSUtils::findDefinitionOf(), QQmlJSLinter::lintModule(), QQmlJSImportVisitor::rootScopeIsValid(), and QQmlSA::Element::sourceLocation().
|
inline |
Definition at line 517 of file qqmljsscope_p.h.
Referenced by canAssign(), QQmlJSTypeResolver::canHold(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_DefineArray(), resolveList(), and QQmlJSTypeResolver::valueType().
|
inline |
Definition at line 515 of file qqmljsscope_p.h.