miqt/qt/mainthread/mainthread.cpp
2025-01-11 16:03:04 +13:00

15 lines
281 B
C++

#include <QMetaObject>
#include <QCoreApplication>
#include "mainthread.h"
extern "C" {
void mainthread_exec_handle(intptr_t);
}
void mainthread_exec(intptr_t cb) {
QMetaObject::invokeMethod(qApp, [=]{
mainthread_exec_handle(cb);
}, Qt::QueuedConnection);
}