Data widget container

dawiq.multitype provides widgets that contain multiple DataWidget to support multiple dataclass types.

class dawiq.multitype.DataclassStackedWidget(*args: Any, **kwargs: Any)[source]

Bases: QStackedWidget

Stacked widget containing multiple DataWidget and their dataclasses.

To add DataWidget, pass the widget and its dataclass to addDataWidget() or to insertDataWidget().

When the data value of current data widget changes, this widget emits currentDataValueChanged signal. When the current data widget is edited by user, currentDataEdited signal is emitted.

addDataWidget(widget: DataWidget, dataclass: Type[DataclassInstance]) int[source]

Add widget with binding it to dataclass.

indexOfDataclass(dataclass: Type[DataclassInstance]) int[source]

Return the index of the widget bound to dataclass.

class dawiq.multitype.DataclassTabWidget(*args: Any, **kwargs: Any)[source]

Bases: QTabWidget

Tab widget containing multiple DataWidget and dataclasses.

To add DataWidget, pass the widget and its dataclass to addDataWidget() or to insertDataWidget().

When current index is changed by user, activated signal is emitted. When the data value of current data widget changes, this widget emits currentDataValueChanged signal. When the current data widget is edited by user, currentDataEdited signal is emitted.

activated

alias of int

addDataWidget(widget, dataclass, icon=None, label=None) int[source]

Add widget with binding it to dataclass.

insertDataWidget(index, widget, dataclass, icon=None, label=None) int[source]

Insert widget with binding it to dataclass.

indexOfDataclass(dataclass: Type[DataclassInstance]) int[source]

Return the index of the widget bound to dataclass.