Have a look at this:
http://doc.trolltech.com/4.3/threads-mandelbrot.html