Skip to content
Snippets Groups Projects
Commit fccd9b2a authored by Morten Sorvig's avatar Morten Sorvig
Browse files

Port examples to Qt 6.7

The Emscripten entry function name is now unique based
on the application name ("$APPNAME_entry"), and must be
specified when creating the wasm instance.

Also some drive-by fixes.
parent 8256fdb0
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>Qt Background Loading</title>
<script src="../testapp/testapp.js"></script>
<script src="../testapp/qtloader.js"></script>
<script>
window.addEventListener('load', async () => {
......@@ -14,8 +15,11 @@
// config object containing standard Emscripten configuration options.
// In addtion, Qt app instances reads a couple of options like "qtContainerElements"
// at startup.
let instance = await createQtAppInstance({
"qtContainerElements": [container]
let instance = await qtLoad({
qt: {
containerElements: [container],
entryFunction: testapp_entry
}
});
// At this point the Qt instance has been created; update the
......
......@@ -18,7 +18,11 @@
window.data = new Uint8Array([1, 2, 3 ,4]);
window.addEventListener('load', async () => {
const instance = await qtLoad({qt:{}});
const instance = await qtLoad({
qt: {
entryFunction: testapp_entry
}
});
// enable the "Call C++" button which calls the function exported from jsinterop.cpp.
const callCppButton = document.getElementById("callcpp");
......
......@@ -23,8 +23,8 @@
const instance = await qtLoad({
qt: {
containerElements: [container],
modulePromise: module,
module: module, // ### decide on which one
module: module,
entryFunction: testapp_entry
}
});
container.style.visibility = "visible";
......@@ -47,7 +47,7 @@
<p>The application windows will appear below, when loaded.</p>
<div id="appcontainer1" style="width:320px; height:200px; visibility:hidden"></div>
<p>Window below not showing? Upgrade to Qt >= 6.5.</p >
<br>
<div id="appcontainer2" style="width:320px; height:200px; visibility:hidden"></div>
</body>
</html>
\ No newline at end of file
......@@ -18,7 +18,11 @@
{
// Create test app instance via the default window.createQtAppInstance entry function
// set by testapp.js
const instance = await qtLoad({});
const instance = await qtLoad({
qt: {
entryFunction: testapp_entry
}
});
// The Qt instance has been created; enable ui.
let addWindow = document.getElementById("create-window-button");
......
......@@ -13,6 +13,7 @@
const instance = await qtLoad({
qt: {
containerElements: containers,
entryFunction: testapp_entry
}
});
});
......
......@@ -13,7 +13,11 @@
// Create Qt application instance. This instance exports openPopup and
// closePopup, which we call below. See ../testapp/popup.cpp for the
// implementation.
window.instance = await qtLoad({});
window.instance = await qtLoad({
qt: {
entryFunction: testapp_entry
}
});
let openPopup = document.getElementById("open-popup");
openPopup.disabled = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment