#include #include #include QCoro::Task MainWindow::processData(const QVector &data) { std::unique_ptr thread(QThread::create([data]() { // Perform some intesive calculation })); thread->start(); ui->setState(tr("Processing is starting...")); co_await qCoro(thread.get()).waitForStarted(); ui->setState(tr("Processing data...")); co_await qCoro(thread.get()).waitForFinished(); ui->setState(tr("Processing done.")); }