PySide: base on the groupbox example of PySide-Example , issue An error native Qt signal is not callable

495 views Asked by At

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

There are 1 answers

1
qurban On

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.