Skip to content

TupleEdit#

TupleEdit widget

Available in backends:

Signals#

  • changed(object) - Emitted when the widget value changes.
  • label_changed(str) - Emitted when the widget label changes.
  • native_parent_changed(object) - Emitted with the backend widget when the widget parent changes.

TupleEdit #

Bases: ValuedContainerWidget[tuple]

A widget to represent a tuple of values.

A TupleEdit container has several child widgets of different type. Their value is represented as a Python tuple object. If a tuple is given as the initial value, types of child widgets are determined one by one. Unlike ListEdit, number of contents is not editable.

Parameters:

  • value (Iterable, default: Undefined ) –

    The starting value for the widget.

  • nullable (bool) –

    If True, the widget will accepts None as a valid value, by default False.

  • options (dict, default: None ) –

    Widget options of child widgets.

annotation: Any property writable #

Return type annotation for the parameter represented by the widget.

ForwardRefs will be resolve when setting the annotation. For TupleEdit, annotation will be like 'tuple[str, int]'.

get_value() -> tuple #

Return current value as a tuple.