diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2021-11-12 09:28:33 +0100 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2021-11-17 18:04:41 +0100 |
commit | 794051a115ca5d03b34fa2288eb3c019f75b34aa (patch) | |
tree | 21b51933ba6dd583e2efce51f2760517bd026719 /src/qmlcompiler/qqmljsscope_p.h | |
parent | a67eba2513504836348f3e07a47c855ea4be413e (diff) |
qmltc: Learn to set QML context for objects
Add the minimal test along the way. The most we can do at present
is to check that root object's context is set correctly. Comprehensive
tests require binding compilation
The QQmlParserStatus::classBegin() shenanigans are skipped for now
Change-Id: I5c28c8a4406753dcf0fc93d968800b4376ec6017
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsscope_p.h')
-rw-r--r-- | src/qmlcompiler/qqmljsscope_p.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsscope_p.h b/src/qmlcompiler/qqmljsscope_p.h index d3143b4b6a..f9922a8f16 100644 --- a/src/qmlcompiler/qqmljsscope_p.h +++ b/src/qmlcompiler/qqmljsscope_p.h @@ -311,6 +311,9 @@ public: void setAccessSemantics(AccessSemantics semantics) { m_semantics = semantics; } AccessSemantics accessSemantics() const { return m_semantics; } + void setRuntimeId(int id) { m_runtimeId = id; } + int runtimeId() const { return m_runtimeId; } + bool isIdInCurrentQmlScopes(const QString &id) const; bool isIdInCurrentJSScopes(const QString &id) const; bool isIdInjectedFromSignal(const QString &id) const; @@ -455,6 +458,7 @@ private: AccessSemantics m_semantics = AccessSemantics::Reference; QQmlJS::SourceLocation m_sourceLocation; + int m_runtimeId = -1; // an index counterpart of "foobar" in `id: foobar` }; struct QQmlJSTypeInfo |