first, qt provides its own mutex class (and other similar classes)
second, in qt, I do not think you have to do that yourself if you want to draw in a widget, have a look at the qt doc. In caet of qt 4, double buffer is automatically achieved
in fact, if your program does not have more than one thread, no lock is necessary