jvconnected.ui.utils
¶
-
class
jvconnected.ui.utils.
GenericQObject
[source]¶ Bases:
PySide2.QtCore.QObject
Utility class to remove some of the boilerplate code needed to implement
QtCore.Property
attributes.The intended pattern uses the following naming convention:
class MyQtObject(GenericQObject): _n_fooValue = Signal() # The 'notify' signal to emit on changes def __init__(self, *args): self._fooValue = 0 # The instance attribute containing the value def _get_fooValue(self): return self._fooValue def _set_fooValue(self, value): self._generic_setter('_fooValue', value) fooValue = Property(_get_fooValue, _set_fooValue, notify=_n_fooValue)
-
_generic_property_changed
(attr: str, old_value: Any, new_value: Any)[source]¶ Fired by
_generic_setter()
on value changes (after the notify signal emission)
-