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

View File

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