Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2022-04-10 17:22:14 +0200
committerChristian Tismer <tismer@stackless.com>2022-05-22 19:27:18 +0200
commit37b5b3e2db07d4256aa17376d231a76ea3c393cd (patch)
treefb70156b3e9525a469708c7119a2f25b65c8e6b1 /examples/scriptableapplication/pythonutils.cpp
parent31deae2a0ea3725d038433f6be91119865a8f399 (diff)
PyEnum: Implement Switchable Qt Enums Using Python Enums
The mapping from Qt Enum to Python Enum was considered to be difficult. Actually, it is easier than thought. As a minimum invasive approach, this implementation changes very little in the first place. The generation process of enums stays almost unchanged, which simplifies handling of the generated code very much. At the end of each generated Enum, we call a special function that grabs the newly generated enum, reads all items and produces a Python class that replaces the enum in-place. We don't generate Python code, but the functional API to create the new enums. There are lots of more optimizations possible, but this concept solves the issue nice and quickly. A harder problem was the need to map all QFlag structures to enum.Flag structures from Python. This caused a sometimes hacky coding because both the old and the new version are supported. This will be totally cleaned up when we remove the old implementation. Pick-to: 6.3 Task-number: PYSIDE-1735 Change-Id: I66991312f2d7b137f110a4db30702b8f3bf518dd Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/scriptableapplication/pythonutils.cpp')
0 files changed, 0 insertions, 0 deletions