pyqt_reactive.protocols.widget_protocols
Widget ABC contracts for OpenHCS UI frameworks.
Defines explicit contracts that all widgets must implement, eliminating duck typing in favor of fail-loud inheritance-based architecture.
Design Philosophy: - Explicit inheritance over duck typing - Fail-loud over fail-silent - Discoverable over scattered - Multiple inheritance for composable capabilities
Inspired by OpenHCS patterns: - StorageBackendMeta: Metaclass auto-registration - MemoryTypeConverter: ABC contracts with adapters - LibraryRegistryBase: Centralized operations
Classes
ABC for widgets that emit change signals. |
|
ABC for widgets that can select from enum values. |
|
ABC for widgets that can display placeholder text. |
|
ABC for widgets that support numeric range configuration. |
|
ABC for widgets that can return a value. |
|
ABC for widgets that can accept a value. |
- class pyqt_reactive.protocols.widget_protocols.ValueGettable[source]
ABC for widgets that can return a value.
All input widgets must implement this to participate in form value extraction.
- class pyqt_reactive.protocols.widget_protocols.ValueSettable[source]
ABC for widgets that can accept a value.
All input widgets must implement this to participate in form value updates.
- class pyqt_reactive.protocols.widget_protocols.PlaceholderCapable[source]
ABC for widgets that can display placeholder text.
Placeholders show inherited/default values without setting actual values.
- class pyqt_reactive.protocols.widget_protocols.RangeConfigurable[source]
ABC for widgets that support numeric range configuration.
Typically implemented by numeric input widgets (spinboxes, sliders).
- class pyqt_reactive.protocols.widget_protocols.EnumSelectable[source]
ABC for widgets that can select from enum values.
Typically implemented by dropdowns and radio button groups.
- class pyqt_reactive.protocols.widget_protocols.ChangeSignalEmitter[source]
ABC for widgets that emit change signals.
Provides explicit contract for signal connection, eliminating duck typing of signal names (textChanged vs valueChanged vs currentIndexChanged).
- abstractmethod connect_change_signal(callback: Callable[[Any], None]) None[source]
Connect callback to widget’s change signal.
The callback will be invoked whenever the widget’s value changes, receiving the new value as its argument.
- Parameters:
callback – Function to call when widget value changes. Signature: callback(new_value: Any) -> None