pyqt_reactive.widgets.shared.checkbox_group_widget

CheckboxGroupWidget for List[Enum] parameters.

Provides explicit type-based dispatch instead of duck typing with monkey-patched methods.

Classes

CheckboxGroupWidget(param_name, enum_type[, ...])

Multi-selection checkbox group for List[Enum] parameters.

class pyqt_reactive.widgets.shared.checkbox_group_widget.CheckboxGroupWidget(param_name: str, enum_type: Type[Enum], current_value: List[Enum] | None = None, parent=None)[source]

Multi-selection checkbox group for List[Enum] parameters.

Uses NoneAwareCheckBox pattern consistently with bool parameters: - Initialize all checkboxes with set_value(None) for placeholder state - Use set_value() instead of setChecked() to properly track placeholder state - Use get_value() in get_selected_values() to distinguish placeholder vs concrete

selection_changed

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

__init__(param_name: str, enum_type: Type[Enum], current_value: List[Enum] | None = None, parent=None)[source]

Initialize checkbox group widget.

Parameters:
  • param_name – Parameter name for display

  • enum_type – Enum type for checkbox options

  • current_value – Initial selected values (None for placeholder state)

  • parent – Parent widget

get_selected_values() List[Enum] | None[source]

Get selected enum values, returning None if all checkboxes are in placeholder state.

Treats List[Enum] like a list of independent bools: - If ALL checkboxes are in placeholder state → return None (inherit from parent) - If ANY checkbox has been clicked → ALL become concrete, return list of checked items

Note: The signal handler ensures that clicking ANY checkbox converts ALL to concrete, so we should never have a mixed state (some placeholder, some concrete).

set_selected_values(values: List[Enum] | None) None[source]

Set selected values.

Parameters:

values – List of enum values to select, or None for placeholder state