qt_binder.binding

class qt_binder.binding.Binding(left, right)[source]

Bases: object

Interface for a single binding pair.

classmethod parse(obj)[source]

Parse a binding expression into the right Binding subclass.

bind(binder, context)[source]

Perform the binding and store the information needed to undo it.

unbind()[source]

Undo the binding.


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 the foo trait on the model object fires a trait change notification, the Binder trait will be assigned. The reverse is not true: see PushedTo and SyncedWith 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 for binder_trait is fired, object.foo will be assigned the sent object. The reverse is not true: see PulledFrom and SyncedWith 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. See PulledFrom and PushedTo for unidirectional synchronization.

Mnemonic: binder_trait is synced with context_trait

Previous topic

qt_binder.binder

Next topic

qt_binder.bound_editor

This Page