diff options
author | Christian Tismer <tismer@stackless.com> | 2022-08-30 16:57:55 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2022-09-01 11:47:20 +0200 |
commit | 5419080e948c89d4f271d7d4a9bf980f647d53f5 (patch) | |
tree | 8b3a0e1719f9cc23eb102d316a6bc78e5bac5e2a /sources/shiboken6/ApiExtractor/abstractmetatype.cpp | |
parent | 20729eb6ffda8771c192e1614f8e53823108cab1 (diff) |
PyEnum: Simplify code generator because of full forgiveness
PyEnum needed extra signature handling in the parser.py file
and the abstractmetatype.cpp file because we needed to decide
at runtime what names are to be generated.
With the full forgiveness mode, all special handling is
still implemented, but the old versions of the enum
representation can also always be used.
The unexpected funny side effect is that we now can remove
all special handling that has been implemented for these cases.
The way how things are written is no longer relevant, although
the new version is still the only one advertized.
Change-Id: I76efc8ffc646d3a04d974d6776a1c9c2b5ffec70
Pick-to: 6.3
Task-number: PYSIDE-1735
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetatype.cpp')
-rw-r--r-- | sources/shiboken6/ApiExtractor/abstractmetatype.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetatype.cpp b/sources/shiboken6/ApiExtractor/abstractmetatype.cpp index a56557e76..b6bd00d18 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetatype.cpp +++ b/sources/shiboken6/ApiExtractor/abstractmetatype.cpp @@ -7,8 +7,6 @@ #include "messages.h" #include "typedatabase.h" #include "containertypeentry.h" -#include "enumtypeentry.h" -#include "flagstypeentry.h" #include "parser/codemodel.h" #include "qtcompat.h" @@ -645,16 +643,8 @@ QString AbstractMetaTypeData::formatPythonSignature() const result += TypeInfo::indirectionKeyword(i); // If it is a flags type, we replace it with the full name: // "PySide6.QtCore.Qt.ItemFlags" instead of "PySide6.QtCore.QFlags<Qt.ItemFlag>" - if (m_typeEntry->isFlags()) { - // PYSIDE-1735: We need to provide both the flags type and the original enum type - // as a choice at runtime. - auto flagsTypeEntry = static_cast<const FlagsTypeEntry *>(m_typeEntry); - auto enumTypeEntry = flagsTypeEntry->originator(); - result = m_typeEntry->targetLangPackage() + u".^^"_s - + flagsTypeEntry->targetLangName() + u"^^"_s - + enumTypeEntry->targetLangName() + u"^^"_s; - } - + if (m_typeEntry->isFlags()) + result = m_typeEntry->qualifiedTargetLangName(); result.replace(u"::"_s, u"."_s); return result; } |