diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-11-13 13:40:56 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-11-18 08:54:47 +0100 |
commit | df179c52ec02aec91058d6977e08a405932af2bd (patch) | |
tree | 8415bb0adb85ecdfe43e2f0cd8182acb76c45dd9 /src/qmlcompiler/qqmljsscope_p.h | |
parent | 7e3f5f2224ba0e57a9dffa6251bb002cde564f56 (diff) |
QmlCompiler: Fix resolution of method and property types
We need to resolve the types for QML elements in two passes because only
after finishing the parsing we have the QML-declared methods and
properties available. We already need the base type before, though.
Also, there can be multiple methods of the same name. We need API to
access them.
It also turns out that the internal name of the "var" type has to be
QVariant in order to match reality. "var" properties and unnamed
arguments to JS functions are implemented as QVariant.
Change-Id: I541f11e96db72d832f4e4443d3a5d31079a56575
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, 2 insertions, 2 deletions
diff --git a/src/qmlcompiler/qqmljsscope_p.h b/src/qmlcompiler/qqmljsscope_p.h index f1ead0ece2..de6ea58906 100644 --- a/src/qmlcompiler/qqmljsscope_p.h +++ b/src/qmlcompiler/qqmljsscope_p.h @@ -160,11 +160,11 @@ public: void addOwnMethod(const QQmlJSMetaMethod &method) { m_methods.insert(method.methodName(), method); } QMultiHash<QString, QQmlJSMetaMethod> ownMethods() const { return m_methods; } - QQmlJSMetaMethod ownMethod(const QString &name) const { return m_methods.value(name); } + QList<QQmlJSMetaMethod> ownMethods(const QString &name) const { return m_methods.values(name); } bool hasOwnMethod(const QString &name) const { return m_methods.contains(name); } bool hasMethod(const QString &name) const; - QQmlJSMetaMethod method(const QString &name) const; + QList<QQmlJSMetaMethod> methods(const QString &name) const; void addEnumeration(const QQmlJSMetaEnum &enumeration) { |