[PyQt] How can I verify if signal was really connected with handler ?

Russell Valentine russ at coldstonelabs.org
Mon Feb 8 18:01:50 GMT 2010


Mateusz Korniak wrote:
> On Saturday 06 of February 2010, Russell Valentine wrote:
>> Mateusz Korniak wrote:
>>> Hi !
>>> How can I verify if signal was really connected with handler ?
>>> Seems I always get True from connect() call.
>> Test it by triggering it on purpose?
> 
> What if signal is triggered by internal KHTML engine conditions which are not  
> easy for me to meet ?
> In fact I expect get signal while I am not getting it, so I wanted to verify I 
> really get connected (signal name mistake etc .. )
> 
> My question is more about connect() return value. Is it expected to return 
> True only if connect was successful ? 
> 
> 
> Regards, 


Yes, connect return value will not give you what you want using the 
old-style signals and slots. You need to use the new style signal and 
slots. Something like:

self.khtmlpart.canceled.connect(self.handler)


See: 
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#new-style-signal-and-slot-support


Russell Valentine


More information about the PyQt mailing list