slint/api/python
Simon Hausmann 82ae731fcb Python: Add support for enums
Support for enums is three-fold:

- Enums are dynamically created by invoking `enum.Enum("NameOfEnum",
  [("Variant1", "Variant1"), ("Variant2", "Variant2"), ...])` and the
  exposed in the module (next to structs).
- They're converted back to `Value::EnumerationValue(enum_name,
  enum_value)` by checking if a supplied value is an instance of
  `enum.Enum` and then querying the name and `__class__.name` fields.
- When coverting a `Value::EnumerationValue` to Python, the hard work
  begins: We now pass along a TypeCollection through all phases of the
  type conversion, which knows about the enums created earlier and tries
  to locate the correct type class and then variant.

Fixes #5828
2025-07-08 14:35:44 +02:00
..
briefcase Bump version number to 1.13.0 2025-06-26 13:30:43 +00:00
slint Python: Add support for enums 2025-07-08 14:35:44 +02:00