#pragma once #include #include #include #include #define async_exec(a) QThreadPool::globalInstance()->start(new LambdaRunnable(a)); class LambdaRunnable : public QRunnable { public: LambdaRunnable(std::function action) { this->action = action; } void run() { this->action(); } private: std::function action; };