aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typesystem.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-09-11 09:45:24 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-09-12 04:49:50 +0000
commit9f7532987dfcebb195fc46a9349975e00ab4ea62 (patch)
tree38bdcf08eb9ece938b7017d704ecc85839536381 /sources/shiboken2/ApiExtractor/typesystem.h
parent253553022f1ea1692795a28efe3a62b39b4f6bb9 (diff)
shiboken: Store null enum values
If an enum has a null value, store that on the EnumTypeEntry for use in Generator::minimalConstructor() as a default value. Fully qualify scoped enum value type entries for this purpose. The value can then be used for default values instead of an ugly static_cast<EnumType>(0). Task-number: PYSIDE-62 Change-Id: I42cb2ca63fb1da6c795df630ab30bded66aac901 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typesystem.h')
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem.h b/sources/shiboken2/ApiExtractor/typesystem.h
index 26f94e3ee..d892cb3a5 100644
--- a/sources/shiboken2/ApiExtractor/typesystem.h
+++ b/sources/shiboken2/ApiExtractor/typesystem.h
@@ -1067,6 +1067,8 @@ private:
PrimitiveTypeEntry* m_referencedTypeEntry = nullptr;
};
+class EnumValueTypeEntry;
+
class EnumTypeEntry : public TypeEntry
{
public:
@@ -1088,6 +1090,9 @@ public:
m_qualifier = q;
}
+ const EnumValueTypeEntry *nullValue() const { return m_nullValue; }
+ void setNullValue(const EnumValueTypeEntry *n) { m_nullValue = n; }
+
void setFlags(FlagsTypeEntry *flags)
{
m_flags = flags;
@@ -1121,6 +1126,7 @@ private:
QString m_packageName;
QString m_qualifier;
QString m_targetLangName;
+ const EnumValueTypeEntry *m_nullValue = nullptr;
QStringList m_rejectedEnums;