View Full Version : using postEvent, but still getting async error

24th May 2006, 18:08
ok guys-

so my prog is simple, i have a HBOX class that has two labels in it. I also have a thread class with a aimple run function, the run function uses postEvent to post and event on the HBOX's event list, this event is passed two qpixmaps. teh customEvent in the HBOX class takes those two qpixmaps and uses setPixmap to set teh two labels to different pics.

oh yeah, in the threads run function, there is a infinite while loop, in this loop, some if statements swtich the pictures around, this is for testing, but i wanted to get the pictures changing

anyway, whenever i make the prog, ill go to run it, and on the first try, there is always a XLib: unexpected async reply error, and my whole thing crashes.....but, if i kill it, then run it again, it runs fine..

can any of you thing of why this might be happening, i thought async only got pissed if you tryed to call functions from a thread.

thanks ahead of time

24th May 2006, 18:15
QPixmaps are stored on the X server, so you shouldn't touch them in a non-GUI thread. What does your thread do exactly?