PySide : How to get the clicked QPushButton object in the QPushButton clicked slot?
Here is what I did to solve the problem:
button = QtGui.QPushButton("start go")
button.clicked.connect(lambda: self.buttonClick(button))
def buttonClick(self, button):
print button.text()
You can just use self.sender()
to determine the object that initiated the signal.
In your code something along the lines of this should work.
button = QtGui.QPushButton("start go")
button.clicked.connect(self.buttonClick)
def buttonClick(self):
print self.sender().text()