问题
Base on the groupbox example of PySide-Example, I add a clicked slot to the pushButton
, such as:
def createPushButtonGroup(self):
...
pushButton = QtGui.QPushButton("&Normal Button")
pushButton.clicked(self.normalClick)
...
def normalClick(self):
print self.sender.pushButton.text()
But it issues an error: TypeError: native Qt signal is not callable
.
回答1:
I can solve this problem like this:
...
pushButton.clicked.connect(lambda: self.normalClick(pushButton))
...
def normalClick(self, sender):
print sender.text()
hope this helps you.
来源:https://stackoverflow.com/questions/20321430/pyside-base-on-the-groupbox-example-of-pyside-example-issue-an-error-native-q