Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
Tracks the types for the QmlCompiler. More...
#include <qqmljsscope_p.h>
Classes | |
struct | AnnotatedScope |
struct | JavaScriptIdentifier |
Friends | |
template<typename T > | |
class | QTypeInfo |
Tracks the types for the QmlCompiler.
QQmlJSScope tracks the types used in qml for the QmlCompiler.
Multiple QQmlJSScope objects might be created for the same conceptual type, except when reused due to extensive caching. Two QQmlJSScope objects are considered equal when they are backed by the same implementation, that is, they have the same internalName.
Definition at line 130 of file qqmljsscope_p.h.
Definition at line 144 of file qqmljsscope_p.h.
using QQmlJSScope::ConstPtr = QDeferredSharedPointer<const QQmlJSScope> |
Definition at line 141 of file qqmljsscope_p.h.
using QQmlJSScope::Export = QQmlJS::Export |
Definition at line 173 of file qqmljsscope_p.h.
using QQmlJSScope::ExportedScope = QQmlJS::ExportedScope<Pointer> |
Definition at line 177 of file qqmljsscope_p.h.
using QQmlJSScope::ImportedScope = QQmlJS::ImportedScope<Pointer> |
Definition at line 175 of file qqmljsscope_p.h.
Definition at line 147 of file qqmljsscope_p.h.
A Hashable type to differentiate document roots from different inline components.
Definition at line 152 of file qqmljsscope_p.h.
Definition at line 139 of file qqmljsscope_p.h.
using QQmlJSScope::QMultiHashRange |
Definition at line 202 of file qqmljsscope_p.h.
using QQmlJSScope::RootDocumentNameType = std::monostate |
Definition at line 148 of file qqmljsscope_p.h.
Definition at line 145 of file qqmljsscope_p.h.
using QQmlJSScope::WeakConstPtr = QDeferredWeakPointer<const QQmlJSScope> |
Definition at line 142 of file qqmljsscope_p.h.
Definition at line 140 of file qqmljsscope_p.h.
Enumerator | |
---|---|
SimplePropertyTarget | |
ListPropertyTarget | |
UnnamedPropertyTarget |
Definition at line 195 of file qqmljsscope_p.h.
Enumerator | |
---|---|
NotExtension | |
ExtensionType | |
ExtensionJavaScript | |
ExtensionNamespace |
Definition at line 345 of file qqmljsscope_p.h.
enum QQmlJSScope::Flag |
Enumerator | |
---|---|
Creatable | |
Composite | |
Singleton | |
Script | |
CustomParser | |
Array | |
InlineComponent | |
WrappedInImplicitComponent | |
HasBaseTypeError | |
ExtensionIsNamespace | |
IsListProperty | |
Structured | |
ExtensionIsJavaScript |
Definition at line 155 of file qqmljsscope_p.h.
|
explicit |
Definition at line 36 of file qqmljsscope.cpp.
References QQmlJSScope(), and internalName().
Referenced by QQmlJSScope().
|
default |
|
inline |
Definition at line 404 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), QQmlJSTypeResolver::canHold(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::contentPointer(), QQmlJSCodeGenerator::contentType(), QQmlJSCodeGenerator::convertStored(), QQmlJSTypePropagator::generate_CallProperty(), QQmlJSCodeGenerator::generate_CallPropertyLookup(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSCodeGenerator::generate_LoadElement(), QQmlJSCodeGenerator::generate_StoreElement(), resolveGeneralizedGroup(), QQmlJSCodeGenerator::run(), and QQmlJSTypeResolver::valueType().
|
inline |
Definition at line 236 of file qqmljsscope_p.h.
References QQmlJSMetaEnum::name().
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 222 of file qqmljsscope_p.h.
References method.
Referenced by insertPropertyIdentifier(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 296 of file qqmljsscope_p.h.
References QQmlJSMetaProperty::propertyName().
Referenced by insertPropertyIdentifier(), and QQmlJSImportVisitor::visit().
void QQmlJSScope::addOwnPropertyBinding | ( | const QQmlJSMetaPropertyBinding & | binding, |
BindingTargetSpecifier | specifier = BindingTargetSpecifier::SimplePropertyTarget ) |
Definition at line 830 of file qqmljsscope.cpp.
References QMultiHash< Key, T >::equal_range(), QMultiHash< Key, T >::insert(), QQmlJS::SourceLocation::isValid(), iter, QQmlJSMetaPropertyBinding::propertyName(), Q_ASSERT, QMultiHash< Key, T >::size(), QList< T >::size(), and QQmlJSMetaPropertyBinding::sourceLocation().
void QQmlJSScope::addOwnRuntimeFunctionIndex | ( | QQmlJSMetaMethod::AbsoluteFunctionIndex | index | ) |
Definition at line 1078 of file qqmljsscope.cpp.
References QList< T >::emplaceBack().
Referenced by QQmlJSImportVisitor::synthesizeCompilationUnitRuntimeFunctionIndices().
|
inline |
Definition at line 265 of file qqmljsscope_p.h.
Referenced by aliases().
|
inline |
Definition at line 248 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::checkDeprecation().
QQmlJSScope::ConstPtr QQmlJSScope::attachedType | ( | ) | const |
Definition at line 1051 of file qqmljsscope.cpp.
References NotExtension, ptr(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSLinter::lintModule(), QQmlJSTypeResolver::memberType(), and testScopeSymbol().
QString QQmlJSScope::attachedTypeName | ( | ) | const |
Definition at line 1035 of file qqmljsscope.cpp.
References NotExtension, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
QString QQmlJSScope::augmentedInternalName | ( | ) | const |
Definition at line 221 of file qqmljsscope.cpp.
References base, and baseType().
Referenced by QQmlJSCodeGenerator::generate_DefineObjectLiteral().
|
inline |
Definition at line 285 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::addDefaultProperties(), augmentedInternalName(), QQmlJSImportVisitor::breakInheritanceCycles(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSImportVisitor::checkDeprecation(), QQmlJSImportVisitor::checkRequiredProperties(), QQmlJSTypeResolver::genericType(), QQmlJSUtils::hasCompositeBase(), isResolved(), isRevisionAllowed(), mayBeUnresolvedGeneralizedGroupedProperty(), QQmlJSTypeResolver::merge(), methodOwnerFrom(), QQmlJSImportVisitor::processDefaultProperties(), propertyOwnerFrom(), qFindInlineComponents(), resolveGeneralizedGroup(), and QQmlJSImportVisitor::visit().
QString QQmlJSScope::baseTypeError | ( | ) | const |
Definition at line 1030 of file qqmljsscope.cpp.
References HasBaseTypeError.
Referenced by QQmlJSImportVisitor::breakInheritanceCycles(), and setBaseTypeError().
QString QQmlJSScope::baseTypeName | ( | ) | const |
Definition at line 1003 of file qqmljsscope.cpp.
References HasBaseTypeError.
Referenced by QQmlJSImportVisitor::breakInheritanceCycles(), QQmlJSImportVisitor::endVisit(), getScopeName(), setBaseTypeName(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 286 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 1182 of file qqmljsscope.cpp.
References derived, internalName(), isComposite(), and Q_ASSERT.
|
inline |
Definition at line 614 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::checkGroupedAndAttachedScopes(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::enterEnvironmentNonUnique(), qFindInlineComponents(), and QQmlJSUtils::traverseFollowingQmlIrObjectStructure().
QVector< QQmlJSScope::ConstPtr > QQmlJSScope::childScopes | ( | ) | const |
Definition at line 1260 of file qqmljsscope.cpp.
References child.
|
inline |
Definition at line 409 of file qqmljsscope_p.h.
|
inline |
Definition at line 410 of file qqmljsscope_p.h.
|
inline |
Definition at line 292 of file qqmljsscope_p.h.
|
static |
Definition at line 55 of file qqmljsscope.cpp.
References create(), QDeferredSharedPointer< T >::isNull(), and parentScope().
Referenced by QQmlJSTypeResolver::adjustOriginalType(), QQmlJSTypeResolver::adjustTrackedType(), QQmlJSTypeResolver::adjustTrackedType(), QQmlJSTypeResolver::generalizeType(), resolveEnums(), QQmlJSTypeResolver::trackedType(), and QQmlJSImportVisitor::visit().
|
inlinestatic |
Definition at line 205 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), clone(), QQmlJSImportVisitor::enterEnvironment(), QQmlJSLinter::lintFile(), resolveEnums(), resolveList(), and QQmlJSAotCompiler::setDocument().
|
static |
Definition at line 41 of file qqmljsscope.cpp.
References internalName().
|
static |
Definition at line 1314 of file qqmljsscope.cpp.
References ptr().
Referenced by QQmlSA::PassManagerPrivate::analyze(), QQmlSA::Binding::attachingType(), QQmlSA::Element::baseType(), QQmlSA::PassManagerPrivate::findPropertyUsePasses(), QQmlSA::Binding::groupType(), QQmlJSLinter::lintFile(), QQmlSA::Binding::objectType(), QQmlSA::Element::parentScope(), QQmlSA::PassManagerPrivate::registerPropertyPass(), QQmlSA::GenericPass::resolveAttached(), QQmlSA::GenericPass::resolveAttachedInFileScope(), QQmlSA::GenericPass::resolveBuiltinType(), QQmlSA::GenericPass::resolveIdToElement(), QQmlSA::GenericPass::resolveLiteralType(), QQmlSA::GenericPass::resolveType(), QQmlSA::GenericPass::resolveTypeInFileScope(), and QQmlSA::PropertyPrivate::type().
|
static |
Definition at line 1321 of file qqmljsscope.cpp.
References ptr().
QString QQmlJSScope::defaultPropertyName | ( | ) | const |
Definition at line 1098 of file qqmljsscope.cpp.
References scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::processDefaultProperties(), and QQmlJSTypeResolver::scopedType().
QQmlJSScope::InlineComponentOrDocumentRootName QQmlJSScope::enclosingInlineComponentName | ( | ) | const |
If this type is part of an inline component, return its name. Otherwise, if this type is part of the document root, return the document root name.
Definition at line 1251 of file qqmljsscope.cpp.
References get().
QQmlJSMetaEnum QQmlJSScope::enumeration | ( | const QString & | name | ) | const |
Definition at line 190 of file qqmljsscope.cpp.
References it, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
QHash< QString, QQmlJSMetaEnum > QQmlJSScope::enumerations | ( | ) | const |
Definition at line 205 of file qqmljsscope.cpp.
References QListSpecialMethodsBase< T >::contains(), QList< T >::insert(), it, results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
|
inline |
Definition at line 380 of file qqmljsscope_p.h.
|
inline |
Definition at line 381 of file qqmljsscope_p.h.
QQmlJSScope::AnnotatedScope QQmlJSScope::extensionType | ( | ) | const |
Definition at line 1067 of file qqmljsscope.cpp.
References ExtensionIsJavaScript, ExtensionIsNamespace, ExtensionJavaScript, ExtensionNamespace, ExtensionType, and NotExtension.
Referenced by QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), and QQmlJSTypeResolver::selectConstructor().
|
inline |
Definition at line 343 of file qqmljsscope_p.h.
|
inline |
Definition at line 250 of file qqmljsscope_p.h.
Referenced by QQmlJSRegisterContent::descriptiveName().
|
static |
Definition at line 719 of file qqmljsscope.cpp.
References QQmlSA::QMLScope, and scope().
Referenced by QQmlJSTypeResolver::scopedType().
|
static |
Finds a type in contextualTypes with given name. If a type is found, then its name is inserted into usedTypes (when provided). If contextualTypes has mode INTERNAl, then namespace resolution for enums is done (eg for Qt::Alignment). If contextualTypes has mode QML, then inline component resolution is done ("qmlFileName.IC" is correctly resolved from qmlFileName).
Definition at line 361 of file qqmljsscope.cpp.
References findType(), QQmlJS::ContextualTypes::INTERNAL, isReferenceType(), QString::left(), QString::length(), listType(), QString::mid(), qFindInlineComponents(), QQmlJS::ContextualTypes::QML, and QStringLiteral.
Referenced by findType(), QQmlJSImportVisitor::processMethodTypes(), QQmlJSImportVisitor::processPropertyTypes(), and resolveEnums().
|
inline |
Definition at line 376 of file qqmljsscope_p.h.
bool QQmlJSScope::hasEnumeration | ( | const QString & | name | ) | const |
Definition at line 169 of file qqmljsscope.cpp.
References scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
bool QQmlJSScope::hasEnumerationKey | ( | const QString & | name | ) | const |
Definition at line 184 of file qqmljsscope.cpp.
References scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
bool QQmlJSScope::hasInterface | ( | const QString & | name | ) | const |
Definition at line 966 of file qqmljsscope.cpp.
References NotExtension, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSImportVisitor::endVisit(), and QQmlJSImportVisitor::processPropertyBindingObjects().
bool QQmlJSScope::hasMethod | ( | const QString & | name | ) | const |
Definition at line 100 of file qqmljsscope.cpp.
References ExtensionNamespace, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
|
inline |
Definition at line 239 of file qqmljsscope_p.h.
Referenced by findDefiningScopeForEnumeration().
bool QQmlJSScope::hasOwnEnumerationKey | ( | const QString & | name | ) | const |
Definition at line 175 of file qqmljsscope.cpp.
Referenced by findDefiningScopeForEnumerationKey().
|
inline |
Definition at line 271 of file qqmljsscope_p.h.
|
inline |
Definition at line 229 of file qqmljsscope_p.h.
Referenced by findDefiningScopeForBinding(), findDefiningScopeForMethod(), and QQmlJSTypeResolver::memberType().
|
inline |
Definition at line 299 of file qqmljsscope_p.h.
Referenced by findDefiningScopeForBinding(), findDefiningScopeForProperty(), and QQmlJSTypeResolver::memberType().
|
inline |
Definition at line 590 of file qqmljsscope_p.h.
References QMultiHash< Key, T >::contains().
Referenced by findScopeOfSpecialItems().
bool QQmlJSScope::hasProperty | ( | const QString & | name | ) | const |
Definition at line 727 of file qqmljsscope.cpp.
References ExtensionNamespace, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSImportVisitor::processPropertyBindings(), resolveNameInQmlScope(), QQmlJSFunctionInitializer::run(), and QQmlJSImportVisitor::visit().
bool QQmlJSScope::hasPropertyBindings | ( | const QString & | name | ) | const |
Definition at line 937 of file qqmljsscope.cpp.
References NotExtension, Q_ASSERT, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
bool QQmlJSScope::inherits | ( | const QQmlJSScope::ConstPtr & | base | ) | const |
std::optional< QString > QQmlJSScope::inlineComponentName | ( | ) | const |
if this->isInlineComponent(), then this getter returns the name of the inline component.
Definition at line 1240 of file qqmljsscope.cpp.
References Q_ASSERT.
Referenced by qFindInlineComponents(), setInlineComponentName(), and QQmlJSImportVisitor::visit().
void QQmlJSScope::insertJSIdentifier | ( | const QString & | name, |
const JavaScriptIdentifier & | identifier ) |
Definition at line 75 of file qqmljsscope.cpp.
References QQmlJSScope::JavaScriptIdentifier::Injected, QQmlSA::JSFunctionScope, QQmlJSScope::JavaScriptIdentifier::kind, QQmlJSScope::JavaScriptIdentifier::LexicalScoped, parentScope(), Q_ASSERT, and QQmlSA::QMLScope.
Referenced by QQmlJSImportVisitor::flushPendingSignalParameters(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().
void QQmlJSScope::insertPropertyIdentifier | ( | const QQmlJSMetaProperty & | prop | ) |
Definition at line 90 of file qqmljsscope.cpp.
References addOwnMethod(), addOwnProperty(), method, property, and QQmlSignalNames::propertyNameToChangedSignalName().
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 268 of file qqmljsscope_p.h.
|
inline |
Definition at line 255 of file qqmljsscope_p.h.
Referenced by QQmlJSScope(), QQmlJSTypeResolver::QQmlJSTypeResolver(), adjustErrorMessage(), adjustErrorMessage(), QQmlJSImportVisitor::breakInheritanceCycles(), QQmlJSTypeResolver::canConvertFromTo(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::changedRegisterVariable(), QQmlJSImportVisitor::checkDeprecation(), QQmlJSCodeGenerator::conversion(), QQmlJSCodeGenerator::convertStored(), create(), QQmlJSRegisterContent::descriptiveName(), QQmlJSCodeGenerator::generate_Construct(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSCodeGenerator::generateEnumLookup(), getScopeName(), internalName(), isSameType(), QQmlJSLinter::lintModule(), QQmlJSCodeGenerator::metaObject(), and QQmlJSCodeGenerator::startInstruction().
|
inline |
Definition at line 377 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 282 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 374 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generateEnumLookup(), isComposite(), isResolved(), isRevisionAllowed(), 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 1284 of file qqmljsscope.cpp.
References QQmlSA::QMLScope.
Referenced by testScopeSymbol().
bool QQmlJSScope::isFullyResolved | ( | ) | const |
Definition at line 1118 of file qqmljsscope.cpp.
References scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSLinter::lintModule(), and QQmlJSImportVisitor::visit().
bool QQmlJSScope::isInCustomParserParent | ( | ) | const |
Checks whether this type or its parents have a custom parser.
Definition at line 1225 of file qqmljsscope.cpp.
References get().
Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::checkGroupedAndAttachedScopes(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::processDefaultProperties(), and QQmlJSImportVisitor::processPropertyBindings().
|
inline |
Definition at line 378 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::checkRequiredProperties(), qFindInlineComponents(), and setInlineComponentName().
|
inline |
Definition at line 382 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::contentPointer(), QQmlJSCodeGenerator::contentType(), and QQmlJSCodeGenerator::convertStored().
bool QQmlJSScope::isNameDeferred | ( | const QString & | name | ) | const |
Definition at line 976 of file qqmljsscope.cpp.
References scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSImportVisitor::endVisit(), and QQmlJSFunctionInitializer::run().
bool QQmlJSScope::isPropertyLocallyRequired | ( | const QString & | name | ) | const |
Definition at line 825 of file qqmljsscope.cpp.
bool QQmlJSScope::isPropertyRequired | ( | const QString & | name | ) | const |
Definition at line 802 of file qqmljsscope.cpp.
References ExtensionNamespace, if(), scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
|
inline |
Definition at line 387 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::canHold(), QQmlJSCodeGenerator::conversion(), QQmlJSCodeGenerator::conversion(), QQmlJSCodeGenerator::convertContained(), QQmlJSCodeGenerator::convertStored(), findType(), QQmlJSCodeGenerator::generate_As(), QQmlJSCodeGenerator::generate_CallPropertyLookup(), QQmlJSCodeGenerator::generate_GetOptionalLookup(), and testScopeSymbol().
bool QQmlJSScope::isResolved | ( | ) | const |
Definition at line 1083 of file qqmljsscope.cpp.
References baseType(), isComposite(), QString::isEmpty(), and nonCompositeBaseType().
bool QQmlJSScope::isSameType | ( | const QQmlJSScope::ConstPtr & | otherScope | ) | const |
Checks whether otherScope is the same type as this.
In addition to checking whether the scopes are identical, we also cover duplicate scopes with the same internal name.
Definition at line 1351 of file qqmljsscope.cpp.
References internalName(), and internalName().
|
inline |
Definition at line 375 of file qqmljsscope_p.h.
|
inline |
Definition at line 384 of file qqmljsscope_p.h.
Referenced by testScopeSymbol().
bool QQmlJSScope::isStructured | ( | ) | const |
Definition at line 1305 of file qqmljsscope.cpp.
References get().
|
inline |
Definition at line 388 of file qqmljsscope_p.h.
|
inline |
Definition at line 379 of file qqmljsscope_p.h.
std::optional< QQmlJSScope::JavaScriptIdentifier > QQmlJSScope::jsIdentifier | ( | const QString & | id | ) | const |
Definition at line 293 of file qqmljsscope.cpp.
References it, QQmlSA::JSFunctionScope, QQmlSA::JSLexicalScope, and scope().
|
inline |
Definition at line 362 of file qqmljsscope_p.h.
|
inline |
Definition at line 361 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), 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 119 of file qqmljsscope.cpp.
References QListSpecialMethodsBase< T >::contains(), ExtensionNamespace, QList< T >::insert(), it, results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSTypePropagator::generate_CallProperty(), QQmlJSTypePropagator::generate_Construct(), hasMethodOrSignal(), resolveNameInQmlScope(), QQmlJSFunctionInitializer::run(), and QQmlJSImportVisitor::visit().
QList< QQmlJSMetaMethod > QQmlJSScope::methods | ( | const QString & | name | ) | const |
Definition at line 137 of file qqmljsscope.cpp.
References QList< T >::append(), ExtensionNamespace, results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
QList< QQmlJSMetaMethod > QQmlJSScope::methods | ( | const QString & | name, |
QQmlJSMetaMethodType | type ) const |
Definition at line 151 of file qqmljsscope.cpp.
References QList< T >::append(), ExtensionNamespace, method, ownMethods(), results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
QString QQmlJSScope::moduleName | ( | ) | const |
The name of the module is only saved in the QmlComponent. Iterate through the parent scopes until the QmlComponent or the root is reached to find out the module name of the component in which this
resides.
Definition at line 1020 of file qqmljsscope.cpp.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 223 of file qqmljsscope_p.h.
|
static |
Definition at line 1334 of file qqmljsscope.cpp.
References base.
Referenced by isRevisionAllowed().
|
inlinestatic |
Definition at line 629 of file qqmljsscope_p.h.
References base.
Referenced by causesImplicitComponentWrapping(), QQmlJSCodeGenerator::contentType(), isComponentRootElement(), isResolved(), and QQmlJSTypeResolver::storedType().
|
default |
|
inline |
Definition at line 338 of file qqmljsscope_p.h.
|
inline |
Definition at line 336 of file qqmljsscope_p.h.
|
inline |
Definition at line 328 of file qqmljsscope_p.h.
|
inline |
Definition at line 274 of file qqmljsscope_p.h.
|
inline |
Definition at line 238 of file qqmljsscope_p.h.
References QQmlJSMetaEnum::value().
|
inline |
Definition at line 237 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::checkEnums().
|
static |
Definition at line 777 of file qqmljsscope.cpp.
References ExtensionNamespace, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
|
inline |
Definition at line 276 of file qqmljsscope_p.h.
std::optional< QQmlJSScope::JavaScriptIdentifier > QQmlJSScope::ownJSIdentifier | ( | const QString & | id | ) | const |
Definition at line 307 of file qqmljsscope.cpp.
References it.
Referenced by QQmlJSTypeResolver::memberType().
QHash< QString, QQmlJSScope::JavaScriptIdentifier > QQmlJSScope::ownJSIdentifiers | ( | ) | const |
Return all the JavaScript identifiers defined in the current scope.
Definition at line 70 of file qqmljsscope.cpp.
|
inline |
Definition at line 227 of file qqmljsscope_p.h.
Referenced by QQmlJSLinter::lintModule(), QQmlJSTypeResolver::memberType(), methods(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 228 of file qqmljsscope_p.h.
|
inline |
Definition at line 289 of file qqmljsscope_p.h.
|
inline |
Definition at line 332 of file qqmljsscope_p.h.
|
inline |
Definition at line 297 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::checkRequiredProperties(), QQmlJSLinter::lintModule(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 298 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::memberType().
|
inline |
Definition at line 580 of file qqmljsscope_p.h.
Referenced by createNonUniqueScopeBinding().
|
inline |
Definition at line 585 of file qqmljsscope_p.h.
References QMultiHash< Key, T >::equal_range().
QList< QQmlJSMetaPropertyBinding > QQmlJSScope::ownPropertyBindingsInQmlIROrder | ( | ) | const |
Definition at line 919 of file qqmljsscope.cpp.
References QMultiHash< Key, T >::equal_range(), Q_ASSERT, and QList< T >::size().
|
inline |
Definition at line 595 of file qqmljsscope_p.h.
References i, Q_ASSERT, and QList< T >::size().
QString QQmlJSScope::parentPropertyName | ( | ) | const |
Definition at line 1108 of file qqmljsscope.cpp.
References scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
|
inline |
Definition at line 565 of file qqmljsscope_p.h.
References QDeferredWeakPointer< T >::toStrongRef().
Referenced by QQmlJSImportVisitor::addDefaultProperties(), clone(), collectFromAllJavaScriptParents(), createNonUniqueScopeBinding(), QQmlJSImportVisitor::endVisit(), findScopeOfSpecialItems(), insertJSIdentifier(), isComponentRootElement(), QQmlJSImportVisitor::leaveEnvironment(), QQmlJSTypeResolver::memberType(), methodFromReferrerScope(), propertyFromReferrerScope(), and reparent().
|
inline |
Definition at line 570 of file qqmljsscope_p.h.
References QT_WARNING_DISABLE_GCC, QT_WARNING_POP, QT_WARNING_PUSH, and QDeferredWeakPointer< T >::toStrongRef().
|
static |
Definition at line 251 of file qqmljsscope.cpp.
References QString::mid().
Referenced by QQmlSA::Element::baseTypeName(), QQmlJSTypeResolver::containedTypeName(), QQmlSA::Element::name(), and QQmlJSLiteralBindingCheck::onBinding().
QHash< QString, QQmlJSMetaProperty > QQmlJSScope::properties | ( | ) | const |
Returns all properties visible from this scope including those of base types and extensions.
Definition at line 760 of file qqmljsscope.cpp.
References QListSpecialMethodsBase< T >::contains(), ExtensionNamespace, QList< T >::insert(), it, results, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
QQmlJSMetaProperty QQmlJSScope::property | ( | const QString & | name | ) | const |
Definition at line 737 of file qqmljsscope.cpp.
References ExtensionNamespace, it, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSUtils::changeHandlerProperty(), QQmlJSTypeResolver::consoleObject(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSTypeResolver::mathObject(), QQmlJSImportVisitor::processDefaultProperties(), QQmlJSImportVisitor::processPropertyBindings(), QQmlJSUtils::propertyFromChangedHandler(), resolve(), resolveSignalOrPropertyExpressionType(), and QQmlJSFunctionInitializer::run().
QList< QQmlJSMetaPropertyBinding > QQmlJSScope::propertyBindings | ( | const QString & | name | ) | const |
Definition at line 949 of file qqmljsscope.cpp.
References it, NotExtension, Q_ASSERT, scope(), and QQmlJSUtils::searchBaseAndExtensionTypes().
Referenced by QQmlJSTypeResolver::scopedType().
QQmlJSScope::Q_FLAGS | ( | Flags | ) |
|
static |
Definition at line 46 of file qqmljsscope.cpp.
References 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 633 of file qqmljsscope.cpp.
References QString::begin(), clone(), QString::constEnd(), create(), QString::end(), QQmlSA::EnumScope, findType(), flagStorage(), QString::insert(), it, QStringLiteral, reparent(), and typeName.
Referenced by resolveTypes().
|
static |
Definition at line 705 of file qqmljsscope.cpp.
References accessSemantics(), baseType(), Q_ASSERT, and resolveNonEnumTypes().
|
static |
Definition at line 671 of file qqmljsscope.cpp.
References create(), QQmlJS::ContextualTypes::INTERNAL, QDeferredSharedPointer< T >::isNull(), listType(), Q_ASSERT, resolveTypes(), setAccessSemantics(), setFilePath(), setInternalName(), setValueTypeName(), and valueType().
Referenced by resolveTypes().
|
static |
Definition at line 592 of file qqmljsscope.cpp.
References resolveTypesInternal().
Referenced by resolveGeneralizedGroup().
|
static |
Definition at line 578 of file qqmljsscope.cpp.
References resolveEnums(), resolveList(), and resolveTypesInternal().
Referenced by QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), resolveList(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().
|
static |
Definition at line 1328 of file qqmljsscope.cpp.
Referenced by QQmlSA::Element::Element(), QQmlSA::Element::accessSemantics(), attachedType(), attachedTypeName(), QQmlSA::Element::baseType(), QQmlSA::Element::baseTypeName(), canConvertForLiteralBinding(), QQmlSA::childScopesBegin(), QQmlSA::childScopesEnd(), defaultPropertyName(), QQmlSA::Element::defaultPropertyName(), enumeration(), enumerations(), QQmlSA::Element::filePath(), findCurrentQMLScope(), QQmlSA::PassManagerPrivate::findPropertyUsePasses(), hasEnumeration(), hasEnumerationKey(), hasInterface(), QQmlSA::Element::hasMethod(), hasMethod(), QQmlSA::Element::hasOwnProperty(), QQmlSA::Element::hasOwnPropertyBindings(), hasProperty(), QQmlSA::Element::hasProperty(), hasPropertyBindings(), QQmlSA::Element::hasPropertyBindings(), QQmlSA::Element::inherits(), QQmlSA::Element::internalId(), QQmlSA::Element::isComposite(), isFullyResolved(), isNameDeferred(), QQmlSA::Element::isNull(), isPropertyRequired(), QQmlSA::Element::isPropertyRequired(), jsIdentifier(), QQmlSA::lookupName(), methods(), methods(), methods(), QQmlSA::Element::name(), QQmlSA::DebugPropertyPass::onBinding(), QQmlSA::DebugPropertyPass::onRead(), QQmlSA::DebugPropertyPass::onWrite(), QQmlSA::Element::operator bool(), QQmlSA::Element::operator!(), QQmlSA::Element::operator=(), ownerOfProperty(), QQmlSA::Element::ownMethods(), QQmlSA::Element::ownPropertyBindings(), QQmlSA::Element::ownPropertyBindings(), parentPropertyName(), QQmlSA::Element::parentScope(), properties(), property(), QQmlSA::Element::property(), propertyBindings(), QQmlSA::Element::propertyBindings(), QQmlSA::GenericPass::resolveAttached(), QQmlSA::GenericPass::resolveAttachedInFileScope(), QQmlSA::GenericPass::resolveElementToId(), QQmlSA::GenericPass::resolveIdToElement(), QQmlSA::Element::scopeType(), and QQmlSA::Element::sourceLocation().
|
inline |
Definition at line 219 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::contentPointer(), createNonUniqueScopeBinding(), QQmlJSImportVisitor::endVisit(), mayBeUnresolvedGeneralizedGroupedProperty(), QQmlJSTypeResolver::memberType(), QQmlJSImportVisitor::synthesizeCompilationUnitRuntimeFunctionIndices(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 403 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), and resolveList().
|
inline |
Definition at line 264 of file qqmljsscope_p.h.
References aliases().
|
inline |
Definition at line 247 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit().
Definition at line 1008 of file qqmljsscope.cpp.
References baseTypeError(), and HasBaseTypeError.
Definition at line 997 of file qqmljsscope.cpp.
References baseTypeName(), and HasBaseTypeError.
Referenced by setScopeName().
|
inline |
Definition at line 391 of file qqmljsscope_p.h.
|
inline |
Definition at line 399 of file qqmljsscope_p.h.
|
inline |
Definition at line 400 of file qqmljsscope_p.h.
Definition at line 344 of file qqmljsscope_p.h.
Definition at line 251 of file qqmljsscope_p.h.
References file.
Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), and resolveList().
|
inline |
Definition at line 603 of file qqmljsscope_p.h.
References CustomParser.
Definition at line 608 of file qqmljsscope_p.h.
References inlineComponentName(), isInlineComponent(), and Q_ASSERT.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 267 of file qqmljsscope_p.h.
Definition at line 256 of file qqmljsscope_p.h.
References internalName().
Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver(), resolveList(), and setScopeName().
|
inline |
Definition at line 396 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 393 of file qqmljsscope_p.h.
|
inline |
Definition at line 397 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 383 of file qqmljsscope_p.h.
|
inline |
Definition at line 394 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().
|
inline |
Definition at line 390 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 398 of file qqmljsscope_p.h.
Definition at line 337 of file qqmljsscope_p.h.
Definition at line 329 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit().
|
inline |
Definition at line 273 of file qqmljsscope_p.h.
|
inline |
Definition at line 275 of file qqmljsscope_p.h.
Definition at line 290 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::visit().
Definition at line 333 of file qqmljsscope_p.h.
Definition at line 794 of file qqmljsscope.cpp.
Referenced by QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().
Definition at line 220 of file qqmljsscope_p.h.
|
inline |
Definition at line 619 of file qqmljsscope_p.h.
References sourceLocation().
|
inline |
Definition at line 392 of file qqmljsscope_p.h.
Definition at line 359 of file qqmljsscope_p.h.
Referenced by resolveList().
|
inlinestaticconstexpr |
Definition at line 458 of file qqmljsscope_p.h.
|
inline |
Definition at line 624 of file qqmljsscope_p.h.
Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::breakInheritanceCycles(), QQmlJSLinter::lintModule(), QQmlJSImportVisitor::rootScopeIsValid(), and setSourceLocation().
|
inline |
Definition at line 360 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::canHold(), QQmlJSTypeResolver::canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::convertStored(), resolveList(), and QQmlJSTypeResolver::valueType().
|
inline |
Definition at line 358 of file qqmljsscope_p.h.
Referenced by QQmlJSTypeResolver::QQmlJSTypeResolver().
|
friend |
Minimal information about a QQmlJSMetaPropertyBinding that allows it to be manipulated similarly to QmlIR::Binding.
Definition at line 467 of file qqmljsscope_p.h.