Make QLabel clickable
I do not understand why you pass QMouseEvent to the parent constructor, you must pass the parent attribute as shown below: class QLabel_alterada(QLabel): clicked=pyqtSignal() def mousePressEvent(self, ev): self.clicked.emit() To avoid having problems with imports we can directly promote the widget as shown below: We place a QLabel and right click and choose Promote to …: … Read more