[PyQt] QButtongroup signal buttonclicked

Hans-Peter Jansen hpj at urpla.net
Tue Mar 15 23:39:59 GMT 2011


On Tuesday 15 March 2011, 22:43:51 F.A.Pinkse wrote:
> Hi All,
>
>
> I have this:
>
> def InitApp(self):
>
>      self.ui.buttonGroup.buttonClicked.connect(ButtonGroupClicked)
>
> def ButtonGroupClicked(clicked):
>      print('clicked', clicked)
>
>   When I run this I get:
>
> clicked <PyQt4.QtGui.QRadioButton object at 0x01602078>
>
>
> How do I communicate which button is clicked with the rest of my
> suite when I only have reference to clicked as QRadiobutton?

Try:
self.ui.buttonGroup.buttonClicked[int].connect(ButtonGroupClicked)

Hth,
Pete


More information about the PyQt mailing list