How to inheritance from the QPushButton class
-
Hi!
How to inheritance from the QPushButton class? When I click a button, I need to get a signal from the objectName of the button.
If I do this, on the click program crashesclass MyPushButton(QPushButton): myClicked = pyqtSignal(str) # self.clicked.connect(self.qqq) def slotForMySignal(self): print(self.objectName()) self.signalNeedUpdate.emit("adg") def __init__(self, *args): QPushButton.__init__(self, *args) self.clicked.connect(self.slotForMySignal) # self.signalNeedUpdate.emit("adg")