RQBoxLayout

class pyreaqtive.layouts.rqboxlayout.RQBoxLayout(model, widget, *args, **kwargs)

Bases: PyQt5.QtWidgets.QBoxLayout

Reactive QBoxLayout

Parameters
__init__(model, widget, *args, **kwargs)

Constructor

Parameters
  • model (pyreaqtive.models.rqlist.RQList) – RQList representing all the items in the layout

  • widget (Union[Type[PyQt5.QtWidgets.QWidget], Callable[[pyreaqtive.models.rqmodel.RQModel, pyreaqtive.models.rqlist.RQList], PyQt5.QtWidgets.QWidget]]) – QWidget type that represents each item. The constructor of the widget must take as arguments: model (RQModel) and list (RQList). Can also be a function that accepts the item model and list model as arguments, and returns the widget instance

  • args – arguments to pass to the native pyqt layout

  • **kwargs – arguments to pass to the native pyqt layout

model: pyreaqtive.models.rqlist.RQList

Model linked to the layout

widgets: List[PyQt5.QtWidgets.QWidget]

List of current widgets in the layout

_rq_widget_callback: Callable[[pyreaqtive.models.rqmodel.RQModel, pyreaqtive.models.rqlist.RQList], PyQt5.QtWidgets.QWidget]

Widget callback. For a new model that is insert on the list, must return the new and appropriate widget

_rq_insert_widget(index)

Slot triggered when the model inserts a new item

Parameters

index – index in the initial of the new instance

Return type

None

_rq_remove_widget(index)

Slot triggered when the model removes a new item

Parameters

index – index in the list of the item removal

Return type

None