[PyQt] Question about the new Signals / Slots mechanism.

Hans-Peter Jansen hpj at urpla.net
Mon Jan 31 20:06:54 GMT 2011


On Monday 31 January 2011, 19:33:04 Thomas Mansencal wrote:
> Hello,
>
> I wanted to update my code to use the new Signals / Slots mechanism
> but I'm running into some troubles that I don't manage to understand.
>
> Here is the snippet that I use :
>
>
> def doStuff(self):

Just make this read:

       def doStuff(self, unused = None):

PyQt tries to cope with a small arkwardness of signals and slots here, 
inherited from Qt: Qt handles superfluous arguments to slots gracefully 
(by ignoring them). Due to the dynamic nature, that's not that easy to 
archive properly in python. PyQt resorts to try to call the slot with 
the number of given arguments down to none until it succeeds. 

BTW, it's way easier to use layouts, even in hand written dialogs. 

Otherwise, this forum would have been labeled VisualBasicNonQt, and I 
wouldn't attend here..

Pete


More information about the PyQt mailing list