qt_binder.binding¶
-
class
qt_binder.binding.Binding(left, right)[source]¶ Bases:
objectInterface for a single binding pair.
-
class
qt_binder.binding.SetOnceTo(left, right)[source]¶ Bases:
qt_binder.binding.BindingEvaluate values once.
The right item of the pair is a string that will be evaluated in the Traits UI context once on initialization.
Mnemonic:
binder_trait is set once to expression
-
class
qt_binder.binding.Factory(left, right)[source]¶ Bases:
qt_binder.binding.BindingCall the factory to initialize a value.
The right item of the pair is a callable that will be called once on initialization to provide a value for the destination trait.
-
class
qt_binder.binding.PulledFrom(left, right)[source]¶ Bases:
qt_binder.binding.BindingListen to traits in the context.
The right item of each pair is a string representing the extended trait to listen to. The first part of this string should be a key into the Traits UI context; e.g. to listen to the
footrait on the model object, use'object.foo'. When thefootrait on the model object fires a trait change notification, theBindertrait will be assigned. The reverse is not true: seePushedToandSyncedWithfor that functionality.Mnemonic:
binder_trait is pulled from context_trait
-
class
qt_binder.binding.PushedTo(left, right)[source]¶ Bases:
qt_binder.binding.BindingSend trait updates from the
Binderto the model.The right item of each pair is a string representing the extended trait to assign the value to. The first part of this string should be a key into the Traits UI context; e.g. to send to the
footrait on the model object, use'object.foo'. When a change notification forbinder_traitis fired,object.foowill be assigned the sent object. The reverse is not true: seePulledFromandSyncedWithfor that functionality.Mnemonic:
binder_trait is sent to context_trait
-
class
qt_binder.binding.SyncedWith(left, right)[source]¶ Bases:
qt_binder.binding.PulledFrom,qt_binder.binding.PushedToBidirectionally synchronize a
Bindertrait and a model trait.The right item of each pair is a string representing the extended trait to synchronize the binder trait with. The first part of this string should be a key into the Traits UI context; e.g. to synchronize with the
footrait on the model object, use'object.foo'. When a change notification for either trait is sent, the value will be assigned to the other. SeePulledFromandPushedTofor unidirectional synchronization.Mnemonic:
binder_trait is synced with context_trait