RQBoxLayout¶
- class pyreaqtive.layouts.rqboxlayout.RQBoxLayout(model: pyreaqtive.models.rqlist.RQList, widget: Union[Type[PyQt5.QtWidgets.QWidget], Callable[[pyreaqtive.models.rqmodel.RQModel, pyreaqtive.models.rqlist.RQList], PyQt5.QtWidgets.QWidget]], *args, **kwargs)¶
Bases:
PyQt5.QtWidgets.QBoxLayoutReactive QBoxLayout
- __init__(model: pyreaqtive.models.rqlist.RQList, widget: Union[Type[PyQt5.QtWidgets.QWidget], Callable[[pyreaqtive.models.rqmodel.RQModel, pyreaqtive.models.rqlist.RQList], PyQt5.QtWidgets.QWidget]], *args, **kwargs)¶
Constructor
- Parameters
model – RQList representing all the items in the layout
widget – 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) → None¶
Slot triggered when the model inserts a new item
- Parameters
index – index in the initial of the new instance
- _rq_remove_widget(index) → None¶
Slot triggered when the model removes a new item
- Parameters
index – index in the list of the item removal