Migrate to using the constructor of QtLoader

Wasm shell used to call the function QtLoader instead of constructing
a new QtLoader. Change this.

Also change the doc to recommend using the constructor.

Change-Id: I57c52eab389aa82449c7db3f4c646ffb234df778
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Mikolaj Boc 2022-10-31 13:32:33 +01:00
parent 0786405857
commit 626ec74359
2 changed files with 5 additions and 5 deletions

View File

@ -18,10 +18,10 @@
// var config = { // var config = {
// containerElements : [$("container-id")]; // containerElements : [$("container-id")];
// } // }
// var qtLoader = QtLoader(config); // var qtLoader = new QtLoader(config);
// qtLoader.loadEmscriptenModule("applicationName"); // qtLoader.loadEmscriptenModule("applicationName");
// //
// External mode.usage: // External mode usage:
// //
// var config = { // var config = {
// canvasElements : [$("canvas-id")], // canvasElements : [$("canvas-id")],
@ -35,7 +35,7 @@
// return canvas; // return canvas;
// } // }
// } // }
// var qtLoader = QtLoader(config); // var qtLoader = new QtLoader(config);
// qtLoader.loadEmscriptenModule("applicationName"); // qtLoader.loadEmscriptenModule("applicationName");
// //
// Config keys // Config keys
@ -118,7 +118,7 @@
// //
// const loader = new QtLoader(config); // const loader = new QtLoader(config);
// //
// styles work. // instantiation types work.
function QtLoader(config) function QtLoader(config)
{ {
return new _QtLoader(config); return new _QtLoader(config);

View File

@ -35,7 +35,7 @@
var canvas = document.querySelector('#qtcanvas'); var canvas = document.querySelector('#qtcanvas');
var status = document.querySelector('#qtstatus') var status = document.querySelector('#qtstatus')
qtLoader = QtLoader({ qtLoader = new QtLoader({
canvasElements : [canvas], canvasElements : [canvas],
showLoader: function(loaderStatus) { showLoader: function(loaderStatus) {
spinner.style.display = 'block'; spinner.style.display = 'block';