[PyQt] Fwd: threading and qt warnings

Darren Dale dd55 at cornell.edu
Thu Sep 6 22:59:55 BST 2007


I am writing some code to allow a pyqt4 program to be run with ipython in a 
separate thread. Using python-2.5.1, qt-4.3.1 and pyqt-4.3, I get the 
following warning messages at each timeout:

QSocketNotifier: Can only be used with threads started with QThread
QApplication::exec: Must be called from the main thread

A short standalone script that reproduces this behavior is attached. If I 
comment out the raw_input statement on line 21, and uncomment lines 22 and 
23, then I do not get the warnings.

I reported the issue at Trolltech, and they suggested that I was somehow 
calling exec_ at every timeout, but I think I am only calling it once. They 
also suggested that I could silence the warnings, and pointed me to 
http://doc.trolltech.com/4.3/qtglobal.html#qWarning, but I was not able to 
silence the warnings by defining a python global QT_NO_WARNING_OUTPUT, or an 
environment variable QT_FATAL_WARNINGS. Is it possible to silence these 
warnings with PyQt4?

If anyone was willing to have a look at the attached script and comment, I 
would really appreciate it.

Thank you,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt4test.py
Type: application/x-python
Size: 973 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070906/575adda1/qt4test.bin

More information about the PyQt mailing list