8#include <QFutureWatcher>
11namespace zrythm::test_helpers
27waitForFutureWithEvents (QFuture<T> &future,
int timeout_ms = 30000)
29 if (future.isFinished ())
32 QFutureWatcher<T> watcher;
34 bool timed_out =
false;
37 &watcher, &QFutureWatcher<T>::finished, &loop, [&loop, &timed_out] () {
42 watcher.setFuture (future);
45 QTimer::singleShot (timeout_ms, &loop, [&loop, &timed_out] () {
52 return !timed_out && future.isFinished ();