Which QLabel was pressed by mousePressEvent
问题 How can I get in method on_product_clicked where QLabel is a mousePressEvent ? In the current example I see three images in the form. When I click the second image I need to have number 2 in the on_product_clicked method. product_images = ['first_icon.png', 'second_icon.png', 'third_icon.png'] self.vbox_choice_img = QHBoxLayout() for image in product_images: label = QLabel() pixmap = QtGui.QPixmap(image) pixmap = pixmap.scaled(250, 250) label.setPixmap(pixmap) label.setAlignment(QtCore.Qt