/
renath
/
organicmaps
Обзор
Документация
Войти
/
renath
/
organicmaps
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
libs/platform/gui_thread_qt.cpp
28 строк
821 B
Alexander Borsuk
New cpp folder structure
20 июл 2025, 22:25
20 июл 2025, 22:25
cb0af64
Код
Авторство
О чём код?
#include "platform/gui_thread.hpp" #include <utility> #include <QtCore/QCoreApplication> namespace platform { base::TaskLoop::PushResult GuiThread::Push(Task && task) { // Following hack is used to post on main message loop |fn| when // |source| is destroyed (at the exit of the code block). QObject source; QObject::connect(&source, &QObject::destroyed, QCoreApplication::instance(), std::move(task)); return {true, base::TaskLoop::kNoId}; } base::TaskLoop::PushResult GuiThread::Push(Task const & task) { // Following hack is used to post on main message loop |fn| when // |source| is destroyed (at the exit of the code block). QObject source; QObject::connect(&source, &QObject::destroyed, QCoreApplication::instance(), task); return {true, base::TaskLoop::kNoId}; } } // namespace platform