20 #ifndef QT_CORE_WORLD_BRIDGE_H_ 21 #define QT_CORE_WORLD_BRIDGE_H_ 42 void build_and_run(
int argc,
char** argv,
const std::function<
void()>& ready);
65 std::shared_ptr<std::promise<T>> promise = std::make_shared<std::promise<T>>();
66 std::future<T> future = promise->get_future();
68 auto t = [promise, task]()
72 promise->set_value(task());
75 promise->set_exception(std::current_exception());
87 #endif // QT_CORE_WORLD_BRIDGE_H_ void destroy()
Destroys the Qt core world and quits its event loop.
void build_and_run(int argc, char **argv, const std::function< void()> &ready)
Sets up the Qt core world and executes its event loop. Blocks until destroy() is called.
std::future< T > enter_with_task_and_expect_result(const std::function< T()> &task)
Enters the Qt core world and schedules the given task for execution.
std::future< void > enter_with_task(const std::function< void()> &task)
Enters the Qt core world and schedules the given task for execution.