diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2021-04-26 11:10:46 +0200 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2021-04-26 14:39:42 +0200 |
commit | 001bec1aa213d47d02efa6a8aed5111aaf67ca7c (patch) | |
tree | f476d1c72ff33671106bd4354a9aa2258f71524b /src/qmlcompiler/qqmljsscope_p.h | |
parent | 784c62441333de8d13d31c719ac01e6096247c01 (diff) |
qmllint: Store property's binding type separately
In the past the type of a property's bindings would override the base type.
This would lead to incompatible type warnings when trying to override that binding with another value that was compatible with the property type but not the binding one.
Change-Id: Ie0c0843e34f24e05aae7bbb429899fbe076e7262
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsscope_p.h')
-rw-r--r-- | src/qmlcompiler/qqmljsscope_p.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsscope_p.h b/src/qmlcompiler/qqmljsscope_p.h index 3a8188a007..f895f5e746 100644 --- a/src/qmlcompiler/qqmljsscope_p.h +++ b/src/qmlcompiler/qqmljsscope_p.h @@ -222,6 +222,26 @@ public: bool isPropertyRequired(const QString &name) const; bool isPropertyLocallyRequired(const QString &name) const; + void addOwnPropertyBinding(const QQmlJSMetaPropertyBinding &binding) + { + m_propertyBindings.insert(binding.propertyName(), binding); + } + QHash<QString, QQmlJSMetaPropertyBinding> ownPropertyBindings() const + { + return m_propertyBindings; + } + QQmlJSMetaPropertyBinding ownPropertyBinding(const QString &name) const + { + return m_propertyBindings.value(name); + } + bool hasOwnPropertyBinding(const QString &name) const + { + return m_propertyBindings.contains(name); + } + + bool hasPropertyBinding(const QString &name) const; + QQmlJSMetaPropertyBinding propertyBinding(const QString &name) const; + bool isResolved() const { return m_baseTypeName.isEmpty() || !m_baseType.isNull(); } bool isFullyResolved() const; @@ -327,6 +347,7 @@ private: QMultiHash<QString, QQmlJSMetaMethod> m_methods; QHash<QString, QQmlJSMetaProperty> m_properties; + QHash<QString, QQmlJSMetaPropertyBinding> m_propertyBindings; QHash<QString, QQmlJSMetaEnum> m_enumerations; QVector<QQmlJSAnnotation> m_annotations; |