diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-11-11 14:12:55 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-11-12 08:06:34 +0100 |
commit | 6a605df673380ffe4e7ee24417175f58ba7972a4 (patch) | |
tree | 182471e75532eefba19aede0a2690688db036ee5 /src/qmlcompiler/qqmljsscope_p.h | |
parent | 262d7eb305e1dea8dac660bec3ccc50193258ea9 (diff) |
QmlCompiler: Allow more convenient access to enums in QQmlJSScope
Change-Id: Ibac4dd7641a89b686bee63cf974b2257a35631a2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsscope_p.h')
-rw-r--r-- | src/qmlcompiler/qqmljsscope_p.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/qmlcompiler/qqmljsscope_p.h b/src/qmlcompiler/qqmljsscope_p.h index 24e401fa0a..0513612e42 100644 --- a/src/qmlcompiler/qqmljsscope_p.h +++ b/src/qmlcompiler/qqmljsscope_p.h @@ -166,8 +166,13 @@ public: bool hasMethod(const QString &name) const; QQmlJSMetaMethod method(const QString &name) const; - void addEnum(const QQmlJSMetaEnum &fakeEnum) { m_enums.insert(fakeEnum.name(), fakeEnum); } - QHash<QString, QQmlJSMetaEnum> enums() const { return m_enums; } + void addEnumeration(const QQmlJSMetaEnum &enumeration) + { + m_enumerations.insert(enumeration.name(), enumeration); + } + QHash<QString, QQmlJSMetaEnum> enumerations() const { return m_enumerations; } + QQmlJSMetaEnum enumeration(const QString &name) const { return m_enumerations.value(name); } + bool hasEnumeration(const QString &name) const { return m_enumerations.contains(name); } QString fileName() const { return m_fileName; } void setFileName(const QString &file) { m_fileName = file; } @@ -246,7 +251,7 @@ private: QMultiHash<QString, QQmlJSMetaMethod> m_methods; QHash<QString, QQmlJSMetaProperty> m_properties; - QHash<QString, QQmlJSMetaEnum> m_enums; + QHash<QString, QQmlJSMetaEnum> m_enumerations; QVector<QQmlJSScope::Ptr> m_childScopes; QQmlJSScope::WeakPtr m_parentScope; |