I suggest you read about QThreadPool and QRunnable and QFuture.