wasm: enable the new event dispatcher for qtcore

Use the new event dispatcher for all non-GUI threads,
nn practice for the main thread when using QCoreApplication,
and when calling QThread::exec().

Change-Id: I9184d52532e06da7e6a87ee27c7d53e0d15e693a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Morten Johan Sørvig 2021-08-18 14:54:11 +02:00
parent ecb92aacab
commit 89cda52d66

View File

@ -47,6 +47,8 @@
#if defined(Q_OS_DARWIN)
# include <private/qeventdispatcher_cf_p.h>
#elif defined(Q_OS_WASM)
# include <private/qeventdispatcher_wasm_p.h>
#else
# if !defined(QT_NO_GLIB)
# include "../kernel/qeventdispatcher_glib_p.h"
@ -250,6 +252,8 @@ QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *dat
return new QEventDispatcherCoreFoundation;
else
return new QEventDispatcherUNIX;
#elif defined(Q_OS_WASM)
return new QEventDispatcherWasm();
#elif !defined(QT_NO_GLIB)
const bool isQtMainThread = data->thread.loadAcquire() == QCoreApplicationPrivate::mainThread();
if (qEnvironmentVariableIsEmpty("QT_NO_GLIB")