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/PySide6/QtGui | |
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/PySide6/QtGui')
-rw-r--r-- | sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml index 49399bc72..923abfd2a 100644 --- a/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml +++ b/sources/pyside6/PySide6/QtGui/typesystem_gui_common.xml @@ -478,10 +478,10 @@ <enum-type name="VerticalAlignment"/> </value-type> <value-type name="QTextFormat" > - <enum-type name="FormatType"/> - <enum-type name="ObjectTypes"/> + <enum-type name="FormatType" python-type="IntEnum"/> + <enum-type name="ObjectTypes" python-type="IntEnum"/> <enum-type name="PageBreakFlag" flags="PageBreakFlags"/> - <enum-type name="Property"/> + <enum-type name="Property" python-type="IntEnum"/> </value-type> <value-type name="QTextListFormat"> <enum-type name="Style"/> @@ -655,11 +655,11 @@ <value-type name="QFont" > <enum-type name="Capitalization"/> <enum-type name="SpacingType"/> - <enum-type name="Stretch"/> + <enum-type name="Stretch" python-type="IntEnum"/> <enum-type name="Style"/> <enum-type name="StyleHint"/> <enum-type name="StyleStrategy"/> - <enum-type name="Weight"/> + <enum-type name="Weight" python-type="IntEnum"/> <enum-type name="HintingPreference" since="4.8" revision="4800"/> <extra-includes> <include file-name="QStringList" location="global"/> |