Fix finalization of BECConnector, BECWidget
Description
This MR ensures BECDispatcher will disconnect all connections, and that BECClient object(s) will have .shutdown()
method called at exit.
It reworks BECWidget
class a bit, only introducing closeEvent()
if it is relevant, i.e if the mixin class is
used with a QWidget
(otherwise there is no closeEvent()
). It defines cleanup()
-does nothing by default-.
BEC Widgets can inherit from:
- BECWidget + a Qt widget
- BECConnector + a Qt class (non-widget, like graphics items from pyqtgraph or
QObject
) - something else (like Jupyter console, just a widget)
In the last case, manual shutdown of client has to be done, if the widget creates a new client...
In other cases, it should be done automatically ; it does not use the RPC Register to know if it can close
connections, because it is not needed and it can be error prone (one has to think about calling register/unregister
).