BindingGroup

Added in version 2.72.

class BindingGroup(**properties: Any)

Superclasses: Object

GBindingGroup can be used to bind multiple properties from an object collectively.

Use the various methods to bind properties from a single source object to multiple destination objects. Properties can be bound bidirectionally and are connected when the source object is set with set_source.

Constructors

class BindingGroup
classmethod new() BindingGroup

Creates a new BindingGroup.

Added in version 2.72.

Methods

class BindingGroup
bind(source_property: str, target: Object, target_property: str, flags: BindingFlags) None

Creates a binding between source_property on the source object and target_property on target. Whenever the source_property is changed the target_property is updated using the same value. The binding flag SYNC_CREATE is automatically specified.

See bind_property() for more information.

Added in version 2.72.

Parameters:
  • source_property – the property on the source to bind

  • target – the target Object

  • target_property – the property on target to bind

  • flags – the flags used to create the Binding

bind_full(source_property: str, target: Object, target_property: str, flags: BindingFlags, transform_to: Callable[[...], Any] | None = None, transform_from: Callable[[...], Any] | None = None) None

Creates a binding between source_property on the source object and target_property on target, allowing you to set the transformation functions to be used by the binding. The binding flag SYNC_CREATE is automatically specified.

See bind_property_full() for more information.

Added in version 2.72.

Parameters:
  • source_property – the property on the source to bind

  • target – the target Object

  • target_property – the property on target to bind

  • flags – the flags used to create the Binding

  • transform_to – the transformation function from the source object to the target, or None to use the default

  • transform_from – the transformation function from the target to the source object, or None to use the default

dup_source() Object | None

Gets the source object used for binding properties.

Added in version 2.72.

set_source(source: Object | None = None) None

Sets source as the source object used for creating property bindings. If there is already a source object all bindings from it will be removed.

Note that all properties that have been bound must exist on source.

Added in version 2.72.

Parameters:

source – the source Object, or None to clear it

Properties

class BindingGroup
props.source: Object

The source object used for binding properties.

Added in version 2.72.