[PyKDE] One slot called two times
apaku at gmx.de
Sat Oct 21 23:32:54 BST 2006
On 21.10.06 22:21:37, Carles Pina i Estany wrote:
> I was used to connect signals and slots using "connect". Now I am
> updating myself to Qt4 and using "autoconnect" feature.
> I have the simplest code that I can do and the slot is called two times.
> The code is:
This is known, but I'm not sure it is documented in the PyQt4 docs.
There are actually 2 signals in QPushButton that are called "clicked",
one takes an argument one doesn't. I don't know how the connection is
done by PyQt, but you end up having both signals connected to your slot.
The proper way to solve this is to use a method signature telling PyQt4
which signal you want to connect to, by giving the proper arguments.
This is documented in the PyQt4 docs (I don't have an example at hand).
Today's weirdness is tomorrow's reason why.
-- Hunter S. Thompson
More information about the PyQt