#include #include int main(int argc, char* argv[]) { QCoreApplication a(argc, argv); QTimer::singleShot(100, [&a] { QMetaObject::invokeMethod(&a, [] { qDebug() << "Hello"; }, Qt::QueuedConnection); }); QTimer::singleShot(200, [&a] { a.exit(); }); return a.exec(); }