Repo created

This commit is contained in:
Fr4nz D13trich 2025-11-22 13:58:55 +01:00
parent 4af19165ec
commit 68073add76
12458 changed files with 12350765 additions and 2 deletions

View file

@ -0,0 +1,28 @@
#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