PDA

View Full Version : QDialog with QPainter in new thread



grucha
21st November 2009, 22:17
My case:
I've main window and I want to create independent (to main thread) QDialog, which contains QPainter. Activities in main window can't affect adversely drawing by painter (e.g. to interrupt his work).

My solution (but effect is another to assumed):
I've created new class inherited by QThread and another class inherited by QDialog. In second one there is QPainter object inside, in first one there is second class instance and implemented run() function follows: call show() method of "QDialog class" and call exec() function.

How to do this better?