[IPython-dev] problems with qt4 threading

Darren Dale dd55 at cornell.edu
Thu Sep 6 17:20:50 EDT 2007

On Thursday 06 September 2007 12:55:31 pm Fernando Perez wrote:
> Hey Darren,
> On 9/6/07, Darren Dale <dd55 at cornell.edu> wrote:
> > I just got a response from Trolltech. The support engineer said that if
> > we continuously receive these warning messages, it means we are calling
> > qapplication.exec_ over and over again, which is we shouldnt be doing.
> >
> > He also said that the warning messages can be suppressed if the global
> > QT_NO_WARNING_OUTPUT is defined
> > (http://doc.trolltech.com/4.3/qtglobal.html#qWarning). I tried adding
> >
> >         global QT_NO_WARNING_OUTPUT
> >         QT_NO_WARNING_OUTPUT = True
> >
> > to IPShellQt4.__init__, but it didnt have any effect. Does anyone know
> > if, and if so why, ipython is calling exec_() at each timeout?
> I didn't write that code (I think you did),

I copied it from the qt3 code, which I didnt write...

> but looking into 
> IPython.Shell, I see this in mainloop() of the Qt4 shell (line 1003):
>         while True:
>             if self.IP._kill: break
>             QtGui.qApp.exec_()
>         self.join()
> You may want to play with that...

I'm attaching a short standalone script that might shed a little more light. 
I've been running it from inside ipython. If the raw_input line in run is 
uncommented, I get the qt warnings. If I comment it out, and I uncomment the 
following two lines, I dont see the warnings. (The mainloop in my script 
doesnt have the while statement mentioned above.)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt4test.py
Type: application/x-python
Size: 976 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20070906/8ff8f3b9/attachment.bin>

More information about the IPython-dev mailing list