0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 11:11:49 +02:00

fix(bec_connector): add assertion to ensure BECConnector is used with a QObject; closes #475

This commit is contained in:
2025-04-12 19:26:29 +02:00
parent 3b16c9f5a2
commit 1921444e15

View File

@ -93,8 +93,12 @@ class BECConnector:
# Ensure the parent is always the first argument for QObject
parent = kwargs.pop("parent", None)
# This initializes the QObject or any qt related class BECConnector has to be used from this line down with QObject, otherwise hierarchy logic will not work
# TODO do a proper check if the class is a QObject -> issue #475
super().__init__(parent=parent, **kwargs)
assert isinstance(
self, QObject
), "BECConnector must be used with a QObject or any qt related class."
# BEC related connections
self.bec_dispatcher = BECDispatcher(client=client)
self.client = self.bec_dispatcher.client if client is None else client