Make ProcessingDialog use a QThreadPool and, accordingly, make ProcessThread inherit from QRunnable rather than QThread.