Closed Czaki closed 1 year ago
The changes primarily enhance the handling of enum classes in the QEnumComboBox
class, adding support for Flag
enums. New utility functions are introduced to generate a list of enum members and retrieve selected enum members. The test suite is expanded with new enum classes and test cases for the updated functionality.
File | Summary |
---|---|
src/superqt/combobox/_enum_combobox.py |
Added support for Flag enums. Introduced utility functions _get_name_with_value and _get_enum_member_list . Updated setEnumClass and currentEnum methods to use these new functions. |
tests/test_enum_comb_box.py |
Expanded test suite with new enum classes (IntFlag1 , Flag1 , IntFlag2 , etc.) and added test cases for the updated QEnumComboBox functionality. |
Patch coverage: 96.42%
and project coverage change: +0.04%
:tada:
Comparison is base (
0b984c2
) 87.34% compared to head (b57a37c
) 87.38%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks @Czaki
Looks like it needs updating for everything below 3.11
Looks like it needs updating for everything below 3.11
Yes. I also hit problems as there was a bug in the new name mechanism in Python 3.11(.3).
As it is fixed in 3.11.5 then I left only the workaround code with a docstring explanation.
As followup #205 I have checked that we do not have a test for another enum base class. So I prevent future failures, I added tests and spotted that flag support was not fully functional as it does not support element combinations.
Also add
StrEnum
test.Summary by CodeRabbit
QEnumComboBox
class to supportFlag
enums in addition to regular enums. This allows users to select multiple options from a combo box.QEnumComboBox
by introducing helper functions for retrieving enum member names and values.Flag
enum support inQEnumComboBox
, ensuring robust functionality and error handling.