You can simply use QtConcurrent to run runnable and use QFuture to wait for completion.
#include <QtConcurrentRun> class MyRunnable : public Runnable{ void run(); }
to execute and wait for it, you can do the following
Qtconcurrent :: run will launch a new thread to execute the run () method on the instance and immediately return a QFuture that tracks the progress of the instance.
Please note that when using this solution, you are responsible for storing the instance in memory at run time.
source share