Performance-wise, the best approach is not to deal with threads directly at all, but use QtConcurrent::run
. It is safe to paint QImages
that are simply passed via signals to a GUI object to display. I wrote a complete example demonstrating that approach. It leads to some very concise and easy-to-understand code thanks to related code being adjacent.
If you do want to use explicit threads, it will be much easier not to derive from QThread
, but to simply move various worker objects into their threads, and have them communicate via signals and slots. I have a complete example for that approach as well.