pyqt  

Re: [PyQt] Q(Core)Application.exec_() is not interruptable

İsmail Dönmez
Thu, 01 May 2008 13:11:57 -0700

Hi,

On Thu, May 1, 2008 at 10:54 PM, Ewald de Wit <[EMAIL PROTECTED]> wrote:
> On Thursday 01 May 2008 14:28:31 İsmail Dönmez wrote:
>  > Following code can't be interrupted with CTRL-C :
>  > >>> import sys
>  > >>> from PyQt4.QtCore import QCoreApplication
>  > >>> QCoreApplication.exec_(sys.argv)
>  >
>  > Is this somehow intended and is there a way to overcome this?
>
>  You can catch the signal like this:
>
>  import signal
>  signal.signal(signal.SIGINT, signal.SIG_DFL)
>
>
>  import sys
>  from PyQt4.QtCore import QCoreApplication
>  app = QCoreApplication(sys.argv)
>  app.exec_()

That indeed works, thanks for the tip!

-- 
Never learn by your mistakes, if you do you may never dare to try again.

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt