diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-03-19 17:24:00 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-04-19 12:51:14 +0000 |
commit | fb7386c18c15ca83aebe8f973c1b018d016baaa9 (patch) | |
tree | 91f0c2988af2e4133a2fdc702fccce69a623b9bf /sources/shiboken2/generator | |
parent | a89690409972501741c846ac8ad4a499f2982809 (diff) |
shiboken: Use enum values from Clang
Remove a lot of ugly value parsing code in favor of
clang_getEnumConstantDeclValue() and
clang_getEnumConstantDeclUnsignedValue() depending on the
type.
Introduce a class EnumValue containing a union of qint64 and quint64 values
to represent signed/unsigned values correctly and use that in the code model
and meta language classes.
Change-Id: If2efb7cfd560237907678b8f6fdfb0bc689c0c93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r-- | sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 72da73aa4..8d4c146c1 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -4529,7 +4529,7 @@ void CppGenerator::writeEnumInitialization(QTextStream& s, const AbstractMetaEnu enumValueText += cppEnum->name() + QLatin1String("::"); enumValueText += enumValue->name(); } else { - enumValueText += QString::number(enumValue->value()); + enumValueText += enumValue->value().toString(); } switch (cppEnum->enumKind()) { |