From a4f311794132c6c24370cb2f5b5e0725b12587fd Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Wed, 4 Jun 2025 13:49:20 +0200 Subject: [PATCH] refactor(image_item): emit object name with removed signal --- bec_widgets/widgets/plots/image/image_base.py | 2 +- bec_widgets/widgets/plots/image/image_item.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bec_widgets/widgets/plots/image/image_base.py b/bec_widgets/widgets/plots/image/image_base.py index a160afc6..f079166e 100644 --- a/bec_widgets/widgets/plots/image/image_base.py +++ b/bec_widgets/widgets/plots/image/image_base.py @@ -123,7 +123,7 @@ class ImageLayerManager: z_position = self._get_bottom_z_position() image = ImageItem(parent_image=self.parent, object_name=name) image.setZValue(z_position) - image.removed.connect(lambda: self._remove_destroyed_layer(name)) + image.removed.connect(self._remove_destroyed_layer) self.layers[name] = ImageLayer(name=name, image=image, sync=sync) self.plot_item.addItem(image) diff --git a/bec_widgets/widgets/plots/image/image_item.py b/bec_widgets/widgets/plots/image/image_item.py index 360d2e72..072d1bc1 100644 --- a/bec_widgets/widgets/plots/image/image_item.py +++ b/bec_widgets/widgets/plots/image/image_item.py @@ -67,7 +67,7 @@ class ImageItem(BECConnector, pg.ImageItem): ] vRangeChangedManually = Signal(tuple) - removed = Signal() + removed = Signal(str) def __init__( self, @@ -277,4 +277,4 @@ class ImageItem(BECConnector, pg.ImageItem): self.clear() super().remove() if emit: - self.removed.emit() + self.removed.emit(self.objectName())