M
Size: a a a
SE
X
PM
X
SE
SE
SE
X
SE
X
SE
X
AT
#include <QApplication>
void funcTest()
{
qDebug() << "in gui thread: " << QThread::currentThread();
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QObject *context = new QObject;
QtConcurrent::run([=]{
qDebug() << "In another thread: " << QThread::currentThread();
QMetaObject::invokeMethod(context, [=](){
funcTest();
}, Qt::QueuedConnection);
});
return a.exec();
}
M