diff options
| author | Christian Tismer <tismer@stackless.com> | 2023-06-15 15:50:31 +0200 |
|---|---|---|
| committer | Christian Tismer <tismer@stackless.com> | 2023-06-30 10:44:58 +0200 |
| commit | 895c452fd874fe4dfeb5a44e8c959136ceedba13 (patch) | |
| tree | 9638efb0bcef53a703efcd8e5906dc9a483a6edb /sources/pyside6/libpyside | |
| parent | 4a09bcbeb4257c7decedf0b4eed1f9847c91c739 (diff) | |
PyEnum: Shortcut old Enum code and generate Python enums directly
The amalgamation of old and new enums is slowly unraveling from the
inside. This meanwhile actually removes the old code.
Included a change by Friedemann to improve enum value handling.
After the signed/unsigned problem was fixed, there was only one case
left where Qt and Clang parser disagreed which could be fixed.
The final solution uses overloaded functions to generate all
necessary cases with minimal footprint in the executable.
Task-number: PYSIDE-1735
Change-Id: I3741ce8621e783a750f3c05241c916008f78f39b
Done-with: Friedemann.Kleint@qt.io (+2 squashed commits)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside')
| -rw-r--r-- | sources/pyside6/libpyside/pysideqflags.cpp | 5 | ||||
| -rw-r--r-- | sources/pyside6/libpyside/pysidesignal.cpp | 2 | ||||
| -rw-r--r-- | sources/pyside6/libpyside/signalmanager.cpp | 1 |
3 files changed, 1 insertions, 7 deletions
diff --git a/sources/pyside6/libpyside/pysideqflags.cpp b/sources/pyside6/libpyside/pysideqflags.cpp index 6c0314e66..bff061bca 100644 --- a/sources/pyside6/libpyside/pysideqflags.cpp +++ b/sources/pyside6/libpyside/pysideqflags.cpp @@ -6,7 +6,6 @@ #include <autodecref.h> #include <sbkenum.h> #include <sbkconverter.h> -#include <sbkenum_p.h> extern "C" { struct SbkConverter; @@ -34,9 +33,7 @@ extern "C" { long val = 0; if (PyTuple_GET_SIZE(args)) { PyObject *arg = PyTuple_GET_ITEM(args, 0); - if (Shiboken::isShibokenEnum(arg)) {// faster call - val = Shiboken::Enum::getValue(arg); - } else if (PyNumber_Check(arg)) { + if (PyNumber_Check(arg)) { Shiboken::AutoDecRef number(PyNumber_Long(arg)); val = PyLong_AsLong(number); } else { diff --git a/sources/pyside6/libpyside/pysidesignal.cpp b/sources/pyside6/libpyside/pysidesignal.cpp index ad2a42802..fc630153c 100644 --- a/sources/pyside6/libpyside/pysidesignal.cpp +++ b/sources/pyside6/libpyside/pysidesignal.cpp @@ -927,8 +927,6 @@ QByteArray getTypeName(PyObject *obType) return QByteArrayLiteral("QVariantList"); if (type == &PyDict_Type) return QByteArrayLiteral("QVariantMap"); - if (Py_TYPE(type) == SbkEnumType_TypeF()) - return Shiboken::Enum::getCppName(type); return QByteArrayLiteral("PyObject"); } if (obType == Py_None) // Must be checked before as Shiboken::String::check accepts Py_None diff --git a/sources/pyside6/libpyside/signalmanager.cpp b/sources/pyside6/libpyside/signalmanager.cpp index aa20c23d6..d0f7fb383 100644 --- a/sources/pyside6/libpyside/signalmanager.cpp +++ b/sources/pyside6/libpyside/signalmanager.cpp @@ -20,7 +20,6 @@ #include <sbkstring.h> #include <sbkstaticstrings.h> #include <sbkerrors.h> -#include <sbkenum_p.h> #include <QtCore/QByteArrayView> #include <QtCore/QDebug> |
