New qtloader
-
I moved to QT 6.9.1 from Qt6.5.3 and now I can't run anymore my application. I get the error "config.qt.entryFunction is not a function". I upgrade my html file to use qtLoad, but it seems that window.createQtAppInstance is not present in the js file created by emsdk. What I'm doing wrong? Who's setting "createQtAppInstance" inside my app?
This is the piece of the html I'm using
const instance = await qtLoad({ qt: { onLoaded: () => showUi(screen), onExit: exitData => { status.innerHTML = 'Application exit'; status.innerHTML += exitData.code !== undefined ? ` with code ${exitData.code}` : ''; status.innerHTML += exitData.text !== undefined ? ` (${exitData.text})` : ''; showUi(spinner); }, entryFunction: window.createQtAppInstance, containerElements: [screen], } });
-
-
Hi, this might be covered by the linked to post, but to answer here as well:
This was changed in 6.9, the entry/constructor function name is not hardcoded to "createQtAppInstance" any more but is now named after the application, with an "_entry" suffix.
For example If you have myapp.js (and load that using e.g. a <script> tag) then you should find the constructor function at window.myapp_entry.
This enables support for loading multiple wasm modules (with separate constructor functions) into a single web page, at the cost of having to name the entry function in the html code.