summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmwindow.cpp
diff options
context:
space:
mode:
authorJuha Vuolle <[email protected]>2025-04-10 14:02:16 +0300
committerJuha Vuolle <[email protected]>2025-04-22 14:28:46 +0300
commita66c73d95e6bb865d1cdae072dc140c7bb6ed6e2 (patch)
tree5a6da1da3cda360a636f20648bcae6306be114b4 /src/plugins/platforms/wasm/qwasmwindow.cpp
parent0bf2fafd38ee94eb31db514beaaa9ea4cb0adba6 (diff)
Allow configuring WASM without draganddrop
Pick-to: 6.9 6.8 Fixes: QTBUG-135874 Change-Id: I84459af06d34682ca3bed1e2e1dab773c77bbcae Reviewed-by: Morten Johan Sørvig <[email protected]>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmwindow.cpp')
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp
index d0cc773cfed..e3e5f064811 100644
--- a/src/plugins/platforms/wasm/qwasmwindow.cpp
+++ b/src/plugins/platforms/wasm/qwasmwindow.cpp
@@ -23,7 +23,9 @@
#include "qwasmevent.h"
#include "qwasmeventdispatcher.h"
#include "qwasmaccessibility.h"
+#if QT_CONFIG(draganddrop)
#include "qwasmdrag.h"
+#endif
#include <iostream>
#include <sstream>
@@ -143,6 +145,7 @@ void QWasmWindow::registerEventHandlers()
[this](emscripten::val event) { this->handlePointerEnterLeaveEvent(PointerEvent(EventType::PointerLeave, event)); }
);
+#if QT_CONFIG(draganddrop)
m_window.call<void>("setAttribute", emscripten::val("draggable"), emscripten::val("true"));
m_dragStartCallback = QWasmEventHandler(m_window, "dragstart",
[this](emscripten::val event) {
@@ -174,6 +177,7 @@ void QWasmWindow::registerEventHandlers()
QWasmDrag::instance()->onNativeDragLeave(&dragEvent);
}
);
+#endif // QT_CONFIG(draganddrop)
m_wheelEventCallback = QWasmEventHandler(m_window, "wheel",
[this](emscripten::val event) { this->handleWheelEvent(event); });