This is almost correct with one exception. QRunnable not a thread, and you should not call your class MyThread . MyRunnable or MyTask or rather.
Please note that your code is almost the same as in the example on the documentation page. Documentation is the best source for brief examples.
You must call waitForDone when you want to wait until all handlers are processed. It depends on your application architecture. This is usually when you created and launched all the QRunnable and want to use their results.
source share