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 ?