qt_binder.binding
¶
-
class
qt_binder.binding.
Binding
(left, right)[source]¶ Bases:
object
Interface for a single binding pair.
-
class
qt_binder.binding.
SetOnceTo
(left, right)[source]¶ Bases:
qt_binder.binding.Binding
Evaluate 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.Binding
Call 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.Binding
Listen 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
foo
trait on the model object, use'object.foo'
. When thefoo
trait on the model object fires a trait change notification, theBinder
trait will be assigned. The reverse is not true: seePushedTo
andSyncedWith
for that functionality.Mnemonic:
binder_trait is pulled from context_trait
-
class
qt_binder.binding.
PushedTo
(left, right)[source]¶ Bases:
qt_binder.binding.Binding
Send trait updates from the
Binder
to 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
foo
trait on the model object, use'object.foo'
. When a change notification forbinder_trait
is fired,object.foo
will be assigned the sent object. The reverse is not true: seePulledFrom
andSyncedWith
for 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.PushedTo
Bidirectionally synchronize a
Binder
trait 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
foo
trait on the model object, use'object.foo'
. When a change notification for either trait is sent, the value will be assigned to the other. SeePulledFrom
andPushedTo
for unidirectional synchronization.Mnemonic:
binder_trait is synced with context_trait