summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qtloader.js
diff options
context:
space:
mode:
authorMorten Sørvig <morten.sorvig@qt.io>2023-12-07 12:11:23 +0100
committerMorten Sørvig <morten.sorvig@qt.io>2023-12-18 23:07:07 +0100
commitf2e227742fe90d2420ab433ae18449f46a210ae8 (patch)
treee0e1fbe300bed9cb72d868d98cd4f0c66605110b /src/plugins/platforms/wasm/qtloader.js
parent37b3cc65499fb9332f9b9ed539bb279217682b1d (diff)
wasm: delay "qtLoaded" qtloader.js event
Currently we send qtLoaded in response to Emscripten onRuntimeInitialized, which is sent just before or at the time main() is called. This can be too early if Qt (app) initialization is not instantaneous, in which case we risk displaying a blank page in between hiding the loading screen and showing the application. Change this to send qtLoaded when QCoreApplication has finished its constructor and the event loop is running. Also add the possibility of registering startup tasks which can delay sending qtLoaded further. We now require a QCoreApplication (or a subclass) instance for the qtLoaded event. onRuntimeInitialized can be used as a replacement if anyone needs the previous behavior. Change-Id: I9298e881d2909aac4040c5f2068e6c7d196196cc Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/plugins/platforms/wasm/qtloader.js')
-rw-r--r--src/plugins/platforms/wasm/qtloader.js2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/plugins/platforms/wasm/qtloader.js b/src/plugins/platforms/wasm/qtloader.js
index 7b9288cd30..1789ad70e3 100644
--- a/src/plugins/platforms/wasm/qtloader.js
+++ b/src/plugins/platforms/wasm/qtloader.js
@@ -160,8 +160,6 @@ async function qtLoad(config)
config.preRun = [];
config.preRun.push(qtPreRun);
- config.onRuntimeInitialized = () => config.qt.onLoaded?.();
-
const originalLocateFile = config.locateFile;
config.locateFile = filename =>
{