composeui.core.signal¶
The signals, which carry events between the views, the model and the app’s code.
- class composeui.core.signal.Signal[source]¶
-
An event that a view, a model or the app emits, with the callbacks connected to it.
connectadds a callback, andemitcalls each callback with the signal’s arguments. A callback with amain_viewormodelparameter gets it by name (seeconnect).- add_qt_signal(signal)[source]¶
Call this signal’s callbacks when the Qt signal
signalemits too.- Parameters:
signal (SignalInstance)
- Return type:
None
- connect(callback: Callable[[Unpack[Ts]], None], *, now: bool = False) None[source]¶
- connect(callback: _MainViewCallback[_MainViewT, Unpack[Ts]], *, now: bool = False) None
- connect(callback: _ModelCallback[Any, Unpack[Ts]], *, now: bool = False) None
- connect(callback: _BoundCallback[_MainViewT, Any, Unpack[Ts]], *, now: bool = False) None
- connect(callback: Callable[[], None], *, now: bool = False) None
- connect(callback: _MainViewOnlyCallback[_MainViewT], *, now: bool = False) None
- connect(callback: _ModelCallback[Any], *, now: bool = False) None
- connect(callback: _BoundCallback[_MainViewT, Any], *, now: bool = False) None
- connect(callback: Callable[[_FirstT], None], *, now: bool = False) None
Call
callbackon each emit, and once right away too ifnow.The callback gets the
main_viewand themodelit asks for by name. It gets only as many of the signal’s arguments as it takes, the first ones, and none when callednow.