[PyQt] QThread and asynchronous Qt events

Albert Cervera i Areny albert at nan-tic.com
Tue May 19 12:33:30 BST 2009


A Dimarts, 19 de maig de 2009, Frédéric Mantegazza va escriure:
> I would like to know if threads based on QThread are safe when sending Qt
> events in Qt3 (I call some GUI methods from these threads)?

You shouldn't be calling GUI methods from other threads than the one with the 
main loop (not even in Qt4 AFAIK). In Qt3 you can postEvents from the thread 
to GUI's main loop. In Qt4 you can also send signals between threads and they 
can optionally be executed by the main loop.

> I know that is is OK with Qt4, as I heavily use them on my Papywizard
> app, but I have some strange error messages on another app, written in
> Qt3, at work:
>
> X Error: BadPixmap (invalid Pixmap parameter) 4
>   Major opcode:  56
>   Minor opcode:  0
>   Resource id:  0x4059d
> X Error: BadLength (poly request too large or internal Xlib length error)
> 16 Major opcode:  20
>   Minor opcode:  0
>   Resource id:  0x4059d
>
> Note that this problem occures on one machine, but not on the other. But
> both machines are very close (same debian etch release ; only hardwares
> differ)...
>
> Any idea what could cause this?


-- 
Albert Cervera i Areny
http://www.NaN-tic.com



More information about the PyQt mailing list