#include #include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); auto context = new QObject; QtConcurrent::run([] { qDebug() << "Task on the pooled thread" << QThread::currentThreadId(); }).then(context, [] { qDebug() << "Continuation on the context (main) thread" << QThread::currentThreadId(); }); return a.exec(); }