summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmintegration.h
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2019-03-16 23:58:36 +0100
committerMorten Johan Sørvig <morten.sorvig@qt.io>2019-04-01 07:18:05 +0000
commit69beb5f5a04bbb5b7fd64e69d1a655c0f5d956cb (patch)
tree25ea750e70d38da66c72e98676138abb0bf474b0 /src/plugins/platforms/wasm/qwasmintegration.h
parent73db765aaf9fad622f050e55e1d240329da0a07c (diff)
wasm: add resizeCanvasElement() API to qtloader.js
HTMl does not have per-element resize events, which means Qt has not way of knowing that a canvas has been resized and that the canvas buffer size should be updated. Depending on the use case, the hosting JavaScript code that caused the canvas resize could also inform Qt that the canvas has been resized. Add API to do this, which calls the existing canvas/screen resize implementation. Other solutions taken/not taken: - browser window resize events: these are available, and we install an event handler in qwasmeventtranslator.cpp. - DOM mutation events: would detect changes to the the size attributes themselves, but not if the size indirectly changed, e.g. “width: 100%” depends on the parent width. Not implemented. Change-Id: Ib324bb30f523e9fceea68000b95bf857a1d36b6c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmintegration.h')
-rw-r--r--src/plugins/platforms/wasm/qwasmintegration.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/platforms/wasm/qwasmintegration.h b/src/plugins/platforms/wasm/qwasmintegration.h
index 01ce6ec007..2239bdc118 100644
--- a/src/plugins/platforms/wasm/qwasmintegration.h
+++ b/src/plugins/platforms/wasm/qwasmintegration.h
@@ -77,6 +77,7 @@ public:
void addScreen(const QString &canvasId);
void removeScreen(const QString &canvasId);
+ void resizeScreen(const QString &canvasId);
private:
mutable QWasmFontDatabase *m_fontDb;