PDA

View Full Version : need to draw on pixmaps outside of the gui thread



Serenius
26th January 2009, 22:10
I need to perform some drawing outside of the main thread (and event loop) and of course I am getting the warning that this can lead to unpredictable behavior.

Predictably, I occasionally hit an assertion inside Qt.

I know it's not recommended, but is there a way to lock/synchronize the painting mechanism so that my thread does not interfere with the event loop painting ?

wysota
26th January 2009, 23:13
You can draw on QImage in non-GUI thread but not on QPixmap.

Serenius
27th January 2009, 16:22
True. I wasn't sure if I can initialize the QImage so it matches my display, but it turned out not to be a problem. I can do all my prep work in a worker thread. Dzieki Kolego!