aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsscope_p.h
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2021-06-04 15:59:26 +0200
committerAndrei Golubev <andrei.golubev@qt.io>2021-06-07 13:53:08 +0200
commit9a706f9715d2af914539656d507d149e4cab5c55 (patch)
tree7c47b9f0ed9871008810027597f503f34c664e60 /src/qmlcompiler/qqmljsscope_p.h
parent4b6655bf98467775f117e3b0edab4731551dbae5 (diff)
QQmlJSScope: add method to query the owner of the property
When calculating absolute property index from the relative QQmlJSMetaProperty::index() value, we need to know the QQmlJSScope that owns the property (to start the value calculation from). The logic of finding the property is non-trivial (due to extension types), so custom QQmlJSScope traversal should really be discouraged While adding a new method, revise existing QQmlJSScope traversal method and make it more generic, so that we could return both (const) QQmlJSScope * and QQmlJSScope::{Ptr, ConstPtr} depending on the use case Change-Id: I84ce038a6a40cdcab3f33ba6a448baa672d62826 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsscope_p.h')
-rw-r--r--src/qmlcompiler/qqmljsscope_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsscope_p.h b/src/qmlcompiler/qqmljsscope_p.h
index fade4d84be..3822cd9c32 100644
--- a/src/qmlcompiler/qqmljsscope_p.h
+++ b/src/qmlcompiler/qqmljsscope_p.h
@@ -248,6 +248,9 @@ public:
bool hasPropertyBinding(const QString &name) const;
QQmlJSMetaPropertyBinding propertyBinding(const QString &name) const;
+ static QQmlJSScope::ConstPtr ownerOfProperty(const QQmlJSScope::ConstPtr &self,
+ const QString &name);
+
bool isResolved() const;
bool isFullyResolved() const;