+ static const int paintInterval = 33;
+
+ QBasicTimer timer;
+ QMutex imageMutex;
+ QMutex syncMutex;
+ QWaitCondition syncCondition;
+ bool terminateThread;
+ int lockCount;
+
+ QImage *image;
+ QPainter *painter;
+
+ QColor fgColor;
+ QColor bgColor;
+
+ bool dirtyFlag;
+ QRect dirtyRect;
+
+ DrawingThread *thread;
+
+ void initialize(ThreadFunction f);
+
+ void applyColor();
+
+ void safeLock(QMutex &mutex);
+ void safeUnlock(QMutex &mutex);
+
+ void dirty();
+ void dirty(int x, int y);
+ void dirty(int x1, int y1, int x2, int y2);
+ void dirty(const QRect &rect);