[PyKDE] linux pyqt/pykde multithread application. How to send signal/ update state of app from non qt loop threads ?

Ismail Donmez ismail at pardus.org.tr
Thu Apr 13 15:47:29 BST 2006


Perşembe 13 Nisan 2006 17:27 tarihinde, Mateusz Korniak şunları yazmıştı: 
> I have multithread pyqt/pykde application.
> I leave first thread to run qt-loop.
>
> I want long execution time code to be run in different threads as in
> background. [1]
>
> How can I interact from those background threads with my qt GUI ? (send
> signal, update text in QLineEdit) ?

You can post an event from the thread using QApplication::postEvent [1] and 
process the event in main gui with QObject::customEvent [2] . Don't use 
signal/slots across threads , Xlib is not thread safe.

[1] http://doc.trolltech.com/3.3/qapplication.html#postEvent
[2] http://doc.trolltech.com/3.3/qobject.html#customEvent

Hope this helps,
ismail

-- 
<Terwou> \\o \o> <o/ o//
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20060413/2ba04e11/attachment.bin


More information about the PyQt mailing list