[PyKDE] Binding parameters to slots

Jeremy Sanders jeremy at jeremysanders.net
Thu Dec 16 15:01:51 GMT 2004


Hi -

I'm trying to connect a signal in my class to a signal, but bind one of 
its parameters to the signalling object:

For instance, I want to do something like

self.connect( button, qt.SIGNAL('clicked()'),
               lambda button=button: sys.stdout.write(button) )

or

self.connect( button, qt.SIGNAL('clicked()'),
               lambda button=button, self=self: self.slotTest(button) )

None of the options I've tried seem to work. Is this possible??

Thanks

Jeremy

-- 
Jeremy Sanders <jeremy at jeremysanders.net>
http://www.jeremysanders.net/                Cambridge, UK
Public Key Server PGP Key ID: E1AAE053




More information about the PyQt mailing list