summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/wasm/CMakeLists.txt6
-rw-r--r--src/plugins/platforms/wasm/qwasmintegration.cpp6
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.cpp4
3 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/platforms/wasm/CMakeLists.txt b/src/plugins/platforms/wasm/CMakeLists.txt
index 7b2d79ce587..b00684a1378 100644
--- a/src/plugins/platforms/wasm/CMakeLists.txt
+++ b/src/plugins/platforms/wasm/CMakeLists.txt
@@ -33,7 +33,6 @@ qt_internal_add_plugin(QWasmIntegrationPlugin
qwasmwindownonclientarea.cpp qwasmwindownonclientarea.h
qwasminputcontext.cpp qwasminputcontext.h
qwasmwindowstack.cpp qwasmwindowstack.h
- qwasmdrag.cpp qwasmdrag.h
DEFINES
QT_EGL_NO_X11
QT_NO_FOREACH
@@ -67,6 +66,11 @@ qt_internal_extend_target(QWasmIntegrationPlugin CONDITION QT_FEATURE_clipboard
qwasmclipboard.cpp qwasmclipboard.h
)
+qt_internal_extend_target(QWasmIntegrationPlugin CONDITION QT_FEATURE_draganddrop
+ SOURCES
+ qwasmdrag.cpp qwasmdrag.h
+)
+
qt_internal_extend_target(QWasmIntegrationPlugin CONDITION QT_FEATURE_opengl
SOURCES
qwasmbackingstore.cpp qwasmbackingstore.h
diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp
index 08092f2cccc..7b4b0421204 100644
--- a/src/plugins/platforms/wasm/qwasmintegration.cpp
+++ b/src/plugins/platforms/wasm/qwasmintegration.cpp
@@ -16,7 +16,9 @@
#include "qwasmwindow.h"
#include "qwasmbackingstore.h"
#include "qwasmfontdatabase.h"
+#if QT_CONFIG(draganddrop)
#include "qwasmdrag.h"
+#endif
#include <qpa/qplatformwindow.h>
#include <QtGui/qscreen.h>
@@ -31,7 +33,9 @@
// this is where EGL headers are pulled in, make sure it is last
#include "qwasmscreen.h"
+#if QT_CONFIG(draganddrop)
#include <private/qsimpledrag_p.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -148,7 +152,9 @@ QWasmIntegration::QWasmIntegration()
visualViewport.call<void>("addEventListener", val("resize"),
val::module_property("qtResizeAllScreens"));
}
+#if QT_CONFIG(draganddrop)
m_drag = std::make_unique<QWasmDrag>();
+#endif
}
QWasmIntegration::~QWasmIntegration()
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); });