RQWidgetObject

class pyreaqtive.widgets.rqwidgetobject.RQWidgetObject(model, layout, widget)

Bases: pyreaqtive.widgets.rqwidget.RQWidget, PyQt5.QtCore.QObject

Reactive 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

Parameters
  • model (pyreaqtive.models.rqobject.RQObject) –

  • layout (PyQt5.QtWidgets.QLayout) –

  • widget (Union[Type[PyQt5.QtWidgets.QWidget], Callable[object, PyQt5.QtWidgets.QWidget]]) –

model: pyreaqtive.models.rqobject.RQObject

Model linked to the widget

__init__(model, layout, widget)

Constructor

Parameters
  • model (pyreaqtive.models.rqobject.RQObject) – Model to link the widget to

  • layout (PyQt5.QtWidgets.QLayout) – layout to place the widget

  • widget (Union[Type[PyQt5.QtWidgets.QWidget], Callable[object, PyQt5.QtWidgets.QWidget]]) – 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()

Generate a new widget from the model

Return type

PyQt5.QtWidgets.QWidget

_rq_data_changed()

Slot triggered when when model has changed

Deletes widget from the layout and adds the new one in the same place

Return type

None

show()
hide()