diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2022-05-12 15:41:25 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2022-05-12 23:50:18 +0000 |
commit | 250f5f4a11ed231dfcbd217ab2d2ce13ab2f9105 (patch) | |
tree | f042eb97ddffc8fd34ecc4f7f1a499416d345b51 /src/plugins | |
parent | f4e998125981038e5e50dab8cc56039faaa0b750 (diff) |
wasm: fix specialHtmlTargets code
Remove .as_handle() call, which was left over from the previous
EM_ASM-based code; see 0ec75f4b9.
Change-Id: I220304074f4d17e706726dab086c0330edc9ef25
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmscreen.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/platforms/wasm/qwasmscreen.cpp b/src/plugins/platforms/wasm/qwasmscreen.cpp index 03c672b9ba..84bb6bb86d 100644 --- a/src/plugins/platforms/wasm/qwasmscreen.cpp +++ b/src/plugins/platforms/wasm/qwasmscreen.cpp @@ -97,7 +97,7 @@ QWasmScreen::QWasmScreen(const emscripten::val &containerOrCanvas) m_onContextMenu = std::make_unique<qstdweb::EventCallback>(m_canvas, "contextmenu", [](emscripten::val event){ event.call<void>("preventDefault"); }); - + // Create "specialHTMLTargets" mapping for the canvas. Normally, Emscripten // uses the html element id when targeting elements, for example when registering // event callbacks. However, this approach is limited to supporting single-document @@ -105,9 +105,8 @@ QWasmScreen::QWasmScreen(const emscripten::val &containerOrCanvas) // As a workaround for this, Emscripten supports registering custom mappings in the // "specialHTMLTargets" object. Add a mapping for the canvas for this screen. emscripten::val specialHtmlTargets = emscripten::val::module_property("specialHTMLTargets"); - std::string id = std::string("!qtcanvas_") + std::to_string(uint32_t(this)); - specialHtmlTargets.set(id, m_canvas.as_handle()); + specialHtmlTargets.set(id, m_canvas); // Install event handlers on the container/canvas. This must be // done after the canvas has been created above. |