[PyQt] How to handle unix signals in PyQt

Giovanni Bajo rasky at develer.com
Wed Jan 28 12:04:29 GMT 2009


On 1/28/2009 2:20 AM, Bobby R. Ward wrote:
> I can't figure out how to handle unix signals in PyQt.
> 
> If I try to connect to the unixSignal signal of QCoreApplication,  
> nothing happens.  I've noticed that the C++ examples call 
> /watchUnixSignal/(signal_num, true) but this isn't exposed in PyQt.
> 
> If I try to use python's standard signal handlers with PyQt I run into 
> some odd situations.  If I comment out the creation of the 
> QCoreApplication the signal is trapped and everything works.  If I  
> create the QCoreApplication, it seems the signal is trapped and ignored 
> by PyQt. 
> 
> I am not even able to use SIGINT to stop the application and I'm forced 
> to use kill to quit the program.
> 
> How am I supposed to handle this?

It's not documented by Trolltech so it's not an "official" function, so 
it's not exposed in PyQt. You might want to separately raise this issue 
with Trolltech to get the function documented.

Do you really need full signal support or where you trying to do simple 
stuff like handling CTRL+C?
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com


More information about the PyQt mailing list