RQWidgetObject¶
- class pyreaqtive.widgets.rqwidgetobject.RQWidgetObject(model: pyreaqtive.models.rqobject.RQObject, layout: PyQt5.QtWidgets.QLayout, widget: Union[Type[PyQt5.QtWidgets.QWidget], Callable[object, PyQt5.QtWidgets.QWidget]])¶
Bases:
pyreaqtive.widgets.rqwidget.RQWidget,PyQt5.QtCore.QObjectReactive Widget Object
Displays a widget for a RQObject. If the instance of the RQObject changes, the widget is destroyed and a new one is created in the same place
- model: pyreaqtive.models.rqobject.RQObject¶
Model linked to the widget
- __init__(model: pyreaqtive.models.rqobject.RQObject, layout: PyQt5.QtWidgets.QLayout, widget: Union[Type[PyQt5.QtWidgets.QWidget], Callable[object, PyQt5.QtWidgets.QWidget]])¶
Constructor
- Parameters
model – Model to link the widget to
layout – layout to place the widget
widget – QWidget type that represents each the instances Can also be a function that accepts the instance as argument, and returns the widget instance
- _rq_new_widget() → PyQt5.QtWidgets.QWidget¶
Generate a new widget from the model
- _rq_data_changed() → None¶
Slot triggered when when model has changed
Deletes widget from the layout and adds the new one in the same place
- show()¶
- hide()¶