diff options
author | Christian Tismer <[email protected]> | 2022-08-03 16:30:51 +0200 |
---|---|---|
committer | Christian Tismer <[email protected]> | 2022-08-13 11:36:08 +0200 |
commit | 0f5dcb03eb258280acd10a0f4f2889301a9ef365 (patch) | |
tree | 561cb3799bd8e0f9d558f25221e1bf6218fcb6e6 /sources/pyside6/tests/QtGui/qpen_test.py | |
parent | 2d7a4fc710e59d0e766ffa101dba383eff46bb50 (diff) |
PyEnum: Define a fixed list of Int(Enum|Flag) decisions
This was "PyEnum: Write a default Int decisor for Enum and Flag".
Historically, C++ enums were all compatible with int.
The new Python enums are more diverse here. There are the
basic types Enum/IntEnum and Flag/IntFlag.
We have tried a lot to come up with a sensible default heuristic
computed from the data. In the end, this was reverted and replaced
by a fixed list that was collected from similar implementations.
By the move away from Int inheritance, a few classes needed extra
support. Python 3.11.0b5 also required the Flag creation parameter
"boundary=KEEP". It is not clear if this is correct, yet.
[ChangeLog][shiboken6] Most former IntEnum/IntFlag are replaced
by pure Enum/Flag classes in a generally compatible way to other
implementations.
Change-Id: I1dbe7b0556a3375df89eb40e9d9f495f14bf42b1
Pick-to: 6.3
Task-number: PYSIDE-1735
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Shyamnath Premnadh <[email protected]>
Reviewed-by: Friedemann Kleint <[email protected]>
Diffstat (limited to 'sources/pyside6/tests/QtGui/qpen_test.py')
-rw-r--r-- | sources/pyside6/tests/QtGui/qpen_test.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sources/pyside6/tests/QtGui/qpen_test.py b/sources/pyside6/tests/QtGui/qpen_test.py index 9e788bdb3..f526cc120 100644 --- a/sources/pyside6/tests/QtGui/qpen_test.py +++ b/sources/pyside6/tests/QtGui/qpen_test.py @@ -26,7 +26,8 @@ class Painting(QRasterWindow): with QPainter(self) as painter: painter.setPen(Qt.NoPen) self.penFromEnum = painter.pen() - painter.setPen(int(Qt.NoPen)) + intVal = Qt.NoPen.value if sys.pyside63_option_python_enum else Qt.NoPen + painter.setPen(intVal) self.penFromInteger = painter.pen() QTimer.singleShot(20, self.close) |