Issue
I am new to PySide. I want to get the QPushButton obj (such as use it to get its text) in its clicked slot.
button = QtGui.QPushButton("start go")
button.clicked.connect(self.buttonClick)
def buttonClick(self):
... # How can I get the button object?
# print button.text() how to get the text : 'start go' ?
Thanks!
Solution
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()
Answered By - qurban
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.