miqt/qt6/mainthread/mainthread.cpp

15 lines
281 B
C++
Raw Normal View History

#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);
}