I have a lot of qlabels
that display images. When click this qlabels mousePressEvent
returns which object clicked and I show this images in another qlabel
with big size.Then I can delete image using qpushbutton
.If users click more qlabels
and then click qpushbutton
, all of images deleted. I want users delete an image per click.So I write a method that delete images but I can't control if user clicks a lot of images and deleting them . How can I do that ?
labels[i].mousePressEvent = functools.partial(self.label_click, source_label = labels[i] ,source_image = pixmap)
def label_click(self, event,source_label=None, source_image=None):
self.labelDisplayBigImage.setPixmap(source_image)
self.labelDisplayBigImage.setScaledContents(True)
if(source_label.picture() == self.labelDisplayBigImage.picture()):
self.btnCancel.clicked.connect(source_label.clear)
self.btnCancel.clicked.connect(self.labelDisplayBigImage.clear)