summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-04-09 14:33:31 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-04-09 14:55:52 +0200
commit574e74ffed00158ab0dc251c2789f4dccbf01eae (patch)
treec3a63856b752f863630c76577206b9e0c949117b
parenta38b017331cda15f39f2728278fb9e8bafa41821 (diff)
TypeDescriptionReader: Read alias and isFlag for enumsv5.15.0-beta4
Change-Id: I7af2860cf18e7cd97cf3e84065172ce582843536 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--tools/qmllint/metatypes.h10
-rw-r--r--tools/qmllint/typedescriptionreader.cpp4
2 files changed, 13 insertions, 1 deletions
diff --git a/tools/qmllint/metatypes.h b/tools/qmllint/metatypes.h
index d67de2edcd..eb832c27ba 100644
--- a/tools/qmllint/metatypes.h
+++ b/tools/qmllint/metatypes.h
@@ -44,8 +44,10 @@
class MetaEnum
{
- QString m_name;
QStringList m_keys;
+ QString m_name;
+ QString m_alias;
+ bool m_isFlag = false;
public:
MetaEnum() = default;
@@ -56,6 +58,12 @@ public:
QString name() const { return m_name; }
void setName(const QString &name) { m_name = name; }
+ QString alias() const { return m_alias; }
+ void setAlias(const QString &alias) { m_alias = alias; }
+
+ bool isFlag() const { return m_isFlag; }
+ void setIsFlag(bool isFlag) { m_isFlag = isFlag; }
+
void addKey(const QString &key) { m_keys.append(key); }
QStringList keys() const { return m_keys; }
};
diff --git a/tools/qmllint/typedescriptionreader.cpp b/tools/qmllint/typedescriptionreader.cpp
index 3dc87ffc8d..12a1cc01d5 100644
--- a/tools/qmllint/typedescriptionreader.cpp
+++ b/tools/qmllint/typedescriptionreader.cpp
@@ -398,6 +398,10 @@ void TypeDescriptionReader::readEnum(UiObjectDefinition *ast, const ScopeTree::P
QString name = toString(script->qualifiedId);
if (name == QLatin1String("name")) {
metaEnum.setName(readStringBinding(script));
+ } else if (name == QLatin1String("alias")) {
+ metaEnum.setAlias(readStringBinding(script));
+ } else if (name == QLatin1String("isFlag")) {
+ metaEnum.setIsFlag(readBoolBinding(script));
} else if (name == QLatin1String("values")) {
readEnumValues(script, &metaEnum);
} else {