aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-10-18 11:48:11 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-19 15:59:29 +0200
commitcc57bac899b6e13078197da7c40ad27fade7ee0d (patch)
treed208286a86ab59db803fe4d175914c7d3d9558c3 /src/qmlcompiler
parentc1c01e21d1a745eccb17d61e10d7f8a4d54d3a43 (diff)
QmlCompiler: Add hasMethod() and hasProperty() to QQmlJSScope
Change-Id: I29e38054a5adcf398f63df7f367ed4bc24c09c75 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler')
-rw-r--r--src/qmlcompiler/qqmljsscope_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsscope_p.h b/src/qmlcompiler/qqmljsscope_p.h
index 619fa09bd6..40bb5ff544 100644
--- a/src/qmlcompiler/qqmljsscope_p.h
+++ b/src/qmlcompiler/qqmljsscope_p.h
@@ -167,6 +167,7 @@ public:
void addMethod(const QQmlJSMetaMethod &method) { m_methods.insert(method.methodName(), method); }
QMultiHash<QString, QQmlJSMetaMethod> methods() const { return m_methods; }
QQmlJSMetaMethod method(const QString &name) const { return m_methods.value(name); }
+ bool hasMethod(const QString &name) const { return m_methods.contains(name); }
void addEnum(const QQmlJSMetaEnum &fakeEnum) { m_enums.insert(fakeEnum.name(), fakeEnum); }
QHash<QString, QQmlJSMetaEnum> enums() const { return m_enums; }
@@ -192,6 +193,7 @@ public:
void addProperty(const QQmlJSMetaProperty &prop) { m_properties.insert(prop.propertyName(), prop); }
QHash<QString, QQmlJSMetaProperty> properties() const { return m_properties; }
QQmlJSMetaProperty property(const QString &name) const { return m_properties.value(name); }
+ bool hasProperty(const QString &name) const { return m_properties.contains(name); }
QString defaultPropertyName() const { return m_defaultPropertyName; }
void setDefaultPropertyName(const QString &name) { m_defaultPropertyName = name; }