summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmeventtranslator.cpp')
-rw-r--r--src/plugins/platforms/wasm/qwasmeventtranslator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
index d6ea147ccf..d99c202c48 100644
--- a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
+++ b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
@@ -32,6 +32,7 @@
#include "qwasmcompositor.h"
#include "qwasmintegration.h"
#include "qwasmclipboard.h"
+#include "qwasmstring.h"
#include <QtGui/qevent.h>
#include <qpa/qwindowsysteminterface.h>
@@ -355,9 +356,10 @@ void QWasmEventTranslator::initEventHandlers()
if (emscripten::val::global("window")["safari"].isUndefined()) {
val document = val::global("document");
- val canvas = document.call<val>("getElementById", val(canvasId));
+ val jsCanvasId = QWasmString::fromQString(screen()->canvasId());
+ val canvas = document.call<val>("getElementById", jsCanvasId);
canvas.call<void>("addEventListener",
- std::string("wheel"),
+ val("wheel"),
val::module_property("qtMouseWheelEvent"));
}
}