![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qqmljstyperesolver_p.h>
Public Types | |
enum | ParentMode { UseDocumentParent , UseParentProperty } |
enum | CloneMode { CloneTypes , DoNotCloneTypes } |
enum class | ComponentIsGeneric { No , Yes } |
enum class | UnaryOperator { Not , Plus , Minus , Increment , Decrement , Complement } |
Protected Member Functions | |
QQmlJSRegisterContent | memberType (QQmlJSRegisterContent type, const QString &name, int baseLookupIndex, int resultLookupIndex) const |
QQmlJSRegisterContent | memberEnumType (QQmlJSRegisterContent type, const QString &name) const |
bool | checkEnums (QQmlJSRegisterContent scope, const QString &name, QQmlJSRegisterContent *result) const |
bool | canPrimitivelyConvertFromTo (const QQmlJSScope::ConstPtr &from, const QQmlJSScope::ConstPtr &to) const |
QQmlJSRegisterContent | lengthProperty (bool isWritable, QQmlJSRegisterContent scope) const |
QQmlJSScope::ConstPtr | containedTypeForName (const QString &name) const |
QQmlJSRegisterContent | registerContentForName (const QString &name, QQmlJSRegisterContent scopeType={}) const |
QQmlJSScope::ConstPtr | resolveParentProperty (const QString &name, const QQmlJSScope::ConstPtr &base, const QQmlJSScope::ConstPtr &propType) const |
Definition at line 33 of file qqmljstyperesolver_p.h.
Enumerator | |
---|---|
CloneTypes | |
DoNotCloneTypes |
Definition at line 51 of file qqmljstyperesolver_p.h.
|
strong |
Enumerator | |
---|---|
No | |
Yes |
Definition at line 196 of file qqmljstyperesolver_p.h.
Enumerator | |
---|---|
UseDocumentParent | |
UseParentProperty |
Definition at line 47 of file qqmljstyperesolver_p.h.
|
strong |
Enumerator | |
---|---|
Not | |
Plus | |
Minus | |
Increment | |
Decrement | |
Complement |
Definition at line 223 of file qqmljstyperesolver_p.h.
QQmlJSTypeResolver::QQmlJSTypeResolver | ( | QQmlJSImporter * | importer | ) |
Definition at line 30 of file qqmljstyperesolver.cpp.
void QQmlJSTypeResolver::adjustOriginalType | ( | QQmlJSRegisterContent | tracked, |
const QQmlJSScope::ConstPtr & | conversion ) const |
Definition at line 584 of file qqmljstyperesolver.cpp.
|
nodiscard |
Definition at line 571 of file qqmljstyperesolver.cpp.
|
nodiscard |
Definition at line 533 of file qqmljstyperesolver.cpp.
|
nodiscard |
Definition at line 565 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::areEquivalentLists | ( | const QQmlJSScope::ConstPtr & | a, |
const QQmlJSScope::ConstPtr & | b ) const |
Definition at line 1354 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 93 of file qqmljstyperesolver_p.h.
QQmlJSRegisterContent QQmlJSTypeResolver::baseType | ( | const QQmlJSScope::ConstPtr & | base, |
QQmlJSRegisterContent | derived ) const |
Encodes base as a base type of derived and returns a QQmlJSRegisterContent. "Base type" here is understood the same way as std::is_base_of would understand it. That means, if you pass the contained type of derived as base, then derived itself is returned.
Definition at line 1801 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 72 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 75 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 148 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 147 of file qqmljstyperesolver_p.h.
bool QQmlJSTypeResolver::canConvertFromTo | ( | const QQmlJSScope::ConstPtr & | from, |
const QQmlJSScope::ConstPtr & | to ) const |
Definition at line 604 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::canConvertFromTo | ( | QQmlJSRegisterContent | from, |
QQmlJSRegisterContent | to ) const |
Definition at line 633 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::canHold | ( | const QQmlJSScope::ConstPtr & | container, |
const QQmlJSScope::ConstPtr & | contained ) const |
Definition at line 777 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::canHoldUndefined | ( | QQmlJSRegisterContent | content | ) | const |
Definition at line 817 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::canPopulate | ( | const QQmlJSScope::ConstPtr & | type, |
const QQmlJSScope::ConstPtr & | argument, | ||
bool * | isExtension ) const |
Definition at line 1274 of file qqmljstyperesolver.cpp.
|
protected |
Definition at line 1411 of file qqmljstyperesolver.cpp.
|
protected |
Definition at line 1243 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 53 of file qqmljstyperesolver_p.h.
QQmlJSScope::ConstPtr QQmlJSTypeResolver::consoleObject | ( | ) | const |
Definition at line 209 of file qqmljstyperesolver.cpp.
|
protected |
Definition at line 430 of file qqmljstyperesolver.cpp.
QQmlJSRegisterContent QQmlJSTypeResolver::convert | ( | QQmlJSRegisterContent | from, |
const QQmlJSScope::ConstPtr & | to ) const |
Definition at line 1887 of file qqmljstyperesolver.cpp.
QQmlJSRegisterContent QQmlJSTypeResolver::convert | ( | QQmlJSRegisterContent | from, |
QQmlJSRegisterContent | to ) const |
Definition at line 1881 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 77 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 78 of file qqmljstyperesolver_p.h.
QQmlJSRegisterContent QQmlJSTypeResolver::elementType | ( | QQmlJSRegisterContent | list | ) | const |
Definition at line 1741 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 59 of file qqmljstyperesolver_p.h.
QQmlJSRegisterContent QQmlJSTypeResolver::extensionType | ( | const QQmlJSScope::ConstPtr & | extension, |
QQmlJSRegisterContent | base ) const |
Definition at line 1787 of file qqmljstyperesolver.cpp.
QQmlJSRegisterContent QQmlJSTypeResolver::extractNonVoidFromOptionalType | ( | QQmlJSRegisterContent | content | ) | const |
Definition at line 854 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 62 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 94 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 95 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 89 of file qqmljstyperesolver_p.h.
void QQmlJSTypeResolver::generalizeType | ( | QQmlJSRegisterContent | type | ) | const |
Definition at line 593 of file qqmljstyperesolver.cpp.
QQmlJSScope::ConstPtr QQmlJSTypeResolver::genericType | ( | const QQmlJSScope::ConstPtr & | type, |
ComponentIsGeneric | allowComponent = ComponentIsGeneric::No ) const |
Definition at line 874 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 117 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 112 of file qqmljstyperesolver_p.h.
bool QQmlJSTypeResolver::inherits | ( | const QQmlJSScope::ConstPtr & | derived, |
const QQmlJSScope::ConstPtr & | base ) const |
Definition at line 1395 of file qqmljstyperesolver.cpp.
void QQmlJSTypeResolver::init | ( | QQmlJSImportVisitor * | visitor, |
QQmlJS::AST::Node * | program ) |
Initializes the type resolver. As part of that initialization, makes visitor traverse the program when given.
Definition at line 185 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 65 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 67 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 69 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 63 of file qqmljstyperesolver_p.h.
bool QQmlJSTypeResolver::isIntegral | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
Definition at line 353 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::isIntegral | ( | QQmlJSRegisterContent | type | ) | const |
Definition at line 348 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::isNativeArrayIndex | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
Definition at line 424 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::isNumeric | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
Definition at line 365 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::isNumeric | ( | QQmlJSRegisterContent | type | ) | const |
Definition at line 343 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::isOptionalType | ( | QQmlJSRegisterContent | content | ) | const |
Definition at line 839 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 107 of file qqmljstyperesolver_p.h.
bool QQmlJSTypeResolver::isPrimitive | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
Definition at line 358 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::isPrimitive | ( | QQmlJSRegisterContent | type | ) | const |
Definition at line 338 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::isSignedInteger | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
Definition at line 412 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::isTriviallyCopyable | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
Definition at line 1370 of file qqmljstyperesolver.cpp.
bool QQmlJSTypeResolver::isUnsignedInteger | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
Definition at line 418 of file qqmljstyperesolver.cpp.
QQmlJSRegisterContent QQmlJSTypeResolver::iteratorPointer | ( | QQmlJSRegisterContent | listType, |
QQmlJS::AST::ForEachType | type, | ||
int | lookupIndex ) const |
Definition at line 1822 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 90 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 98 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 86 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 85 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 1537 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 87 of file qqmljstyperesolver_p.h.
QQmlJSRegisterContent QQmlJSTypeResolver::literalType | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
The type of a JavaScript literal value appearing in script code
Definition at line 961 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 42 of file qqmljstyperesolver_p.h.
QQmlJSScope::ConstPtr QQmlJSTypeResolver::mathObject | ( | ) | const |
Definition at line 204 of file qqmljstyperesolver.cpp.
|
protected |
Definition at line 1662 of file qqmljstyperesolver.cpp.
|
protected |
Definition at line 1550 of file qqmljstyperesolver.cpp.
QQmlJSRegisterContent QQmlJSTypeResolver::memberType | ( | QQmlJSRegisterContent | type, |
const QString & | name, | ||
int | lookupIndex = QQmlJSRegisterContent::InvalidLookupIndex ) const |
Definition at line 1681 of file qqmljstyperesolver.cpp.
QQmlJSScope::ConstPtr QQmlJSTypeResolver::merge | ( | const QQmlJSScope::ConstPtr & | a, |
const QQmlJSScope::ConstPtr & | b ) const |
Definition at line 690 of file qqmljstyperesolver.cpp.
QQmlJSRegisterContent QQmlJSTypeResolver::merge | ( | QQmlJSRegisterContent | a, |
QQmlJSRegisterContent | b ) const |
Definition at line 645 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 88 of file qqmljstyperesolver_p.h.
QQmlJSRegisterContent QQmlJSTypeResolver::namedType | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
A type named explicitly, for example in "as"-casts or as function annotation.
Definition at line 981 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 127 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 60 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 146 of file qqmljstyperesolver_p.h.
QQmlJSRegisterContent QQmlJSTypeResolver::operationType | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
The type of the result of a JavaScript operation
Definition at line 971 of file qqmljstyperesolver.cpp.
QQmlJSRegisterContent QQmlJSTypeResolver::original | ( | QQmlJSRegisterContent | type | ) | const |
Definition at line 521 of file qqmljstyperesolver.cpp.
QQmlJSScope::ConstPtr QQmlJSTypeResolver::originalContainedType | ( | QQmlJSRegisterContent | container | ) | const |
Definition at line 527 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 49 of file qqmljstyperesolver_p.h.
QQmlJSRegisterContent QQmlJSTypeResolver::parentScope | ( | const QQmlJSScope::ConstPtr & | parent, |
QQmlJSRegisterContent | child ) const |
Encodes parent as a parent scope of child and returns a QQmlJSRegisterContent. "Parent scope" here means any scope above, but also including child. That means, if you pass the contained type of child as parent, then child itself is returned.
Definition at line 1815 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 84 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 92 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 91 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 96 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 61 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 80 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 452 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 41 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 1026 of file qqmljstyperesolver.cpp.
QQmlJSRegisterContent QQmlJSTypeResolver::returnType | ( | const QQmlJSMetaMethod & | method, |
const QQmlJSScope::ConstPtr & | returnType, | ||
QQmlJSRegisterContent | scope ) const |
Definition at line 1780 of file qqmljstyperesolver.cpp.
QQmlJSScope::ConstPtr QQmlJSTypeResolver::scopedType | ( | const QQmlJSScope::ConstPtr & | scope, |
const QString & | name, | ||
QQmlJSScopesByIdOptions | options = Default ) const |
Retrieves the type of whatever name signifies in the given scope. name can be an ID, a property of the scope, a singleton, an attachment, a plain type reference or a JavaScript global.
TODO: The lookup is actually wrong. We cannot really retrieve JavaScript globals here because any runtime-inserted context property would override them. We still do because we don't have a better solution for identifying e.g. the console object, yet.
options tells us whether to consider components as bound. If components are bound we can retrieve objects identified by ID in outer contexts.
TODO: This is also wrong because we should alternate scopes and contexts when traveling the scope/context hierarchy. Currently we have IDs from any context override all scope properties if components are considered bound. This is mostly because we don't care about outer scopes at all; so we cannot determine with certainty whether an ID from a far outer context is overridden by a property of a near outer scope. To complicate this further, user context properties can also be inserted in outer contexts at run time, shadowing names in further removed outer scopes and contexts. What we need to do is determine where exactly what kind of property can show up and defend against that with additional pragmas.
Note: It probably takes at least 3 nested bound components in one document to trigger the misbehavior.
Definition at line 1081 of file qqmljstyperesolver.cpp.
QQmlJSRegisterContent QQmlJSTypeResolver::scopedType | ( | QQmlJSRegisterContent | scope, |
const QString & | name, | ||
int | lookupIndex = QQmlJSRegisterContent::InvalidLookupIndex, | ||
QQmlJSScopesByIdOptions | options = Default ) const |
Same as the other scopedType method, but accepts a QQmlJSRegisterContent and also returns one. This way you not only get the type, but also the content variant and various meta info.
Definition at line 1148 of file qqmljstyperesolver.cpp.
QQmlJSScope::ConstPtr QQmlJSTypeResolver::scopeForLocation | ( | const QV4::CompiledData::Location & | location | ) | const |
Definition at line 215 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 132 of file qqmljstyperesolver_p.h.
QQmlJSMetaMethod QQmlJSTypeResolver::selectConstructor | ( | const QQmlJSScope::ConstPtr & | type, |
const QQmlJSScope::ConstPtr & | argument, | ||
bool * | isExtension ) const |
Definition at line 1295 of file qqmljstyperesolver.cpp.
Definition at line 52 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 48 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 154 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 71 of file qqmljstyperesolver_p.h.
QQmlJSScope::ConstPtr QQmlJSTypeResolver::storedType | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
Definition at line 1844 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 74 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 73 of file qqmljstyperesolver_p.h.
QQmlJSRegisterContent QQmlJSTypeResolver::syntheticType | ( | const QQmlJSScope::ConstPtr & | type | ) | const |
Definition at line 987 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 79 of file qqmljstyperesolver_p.h.
QQmlJSRegisterContent QQmlJSTypeResolver::typeForArithmeticUnaryOperation | ( | UnaryOperator | op, |
QQmlJSRegisterContent | operand ) const |
Definition at line 317 of file qqmljstyperesolver.cpp.
QQmlJSRegisterContent QQmlJSTypeResolver::typeForBinaryOperation | ( | QSOperator::Op | oper, |
QQmlJSRegisterContent | left, | ||
QQmlJSRegisterContent | right ) const |
Definition at line 260 of file qqmljstyperesolver.cpp.
QQmlJSScope::ConstPtr QQmlJSTypeResolver::typeForConst | ( | QV4::ReturnedValue | rv | ) | const |
Definition at line 235 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 139 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 122 of file qqmljstyperesolver_p.h.
QQmlJSScope::ConstPtr QQmlJSTypeResolver::typeFromAST | ( | QQmlJS::AST::Type * | type | ) | const |
Definition at line 223 of file qqmljstyperesolver.cpp.
|
inline |
Definition at line 66 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 68 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 70 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 64 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 76 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 81 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 82 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 83 of file qqmljstyperesolver_p.h.
|
inline |
Definition at line 58 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 309 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 321 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 324 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 355 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 326 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 327 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 306 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 311 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 343 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 344 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 341 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 350 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 314 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 316 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 318 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 312 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 342 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 346 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 335 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 334 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 336 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 356 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 340 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 307 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 308 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 348 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 349 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 354 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 303 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 333 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 338 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 337 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 339 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 310 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 329 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 352 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 351 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 320 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 323 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 322 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 328 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 315 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 317 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 319 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 313 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 325 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 330 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 331 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 332 of file qqmljstyperesolver_p.h.
|
protected |
Definition at line 305 of file qqmljstyperesolver_p.h.