[PyKDE] Problems with auto-connect and QAbstractButton.clicked()

Phil Thompson phil at riverbankcomputing.co.uk
Thu Jan 26 17:12:15 GMT 2006


On Thursday 26 January 2006 3:49 pm, Andreas Pakulat wrote:
> Hi,
>
> I have 2 problems with QAbstractButton.clicked and auto-connection:
>
> 1. the auto-connected slot gets called twice, I have no idea why

Because the signal is emitted twice, once with no argument and once with a 
bool argument.

> 2. according to Qt4 docs clicked has a boolean argument which I cannot
> use with the autoconnected slot.

It has an optional bool argument so define the slot as...

    def on_pushButton_clicked(self, checked=None):

...and then decide which call you are going to respond to (until I look at 
Torsten's suggestion of using decorators).

Phil




More information about the PyQt mailing list