diff options
author | Lorn Potter <lorn.potter@gmail.com> | 2022-04-04 18:08:41 +1000 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2022-05-10 01:20:45 +0000 |
commit | d490501641b1f3990382d3ad3523233fdbf3da61 (patch) | |
tree | 4b52e4e083c0175a9dad058b8c40345747f8955f /src/plugins/platforms/wasm/qwasmintegration.cpp | |
parent | 877c158c5976bebffd0ff02c39b6b66a842c6344 (diff) |
wasm: add support for drag into browser window
Drag and drop into the browser will work.
Drag and drop out of the browser will not.
Fixes: QTBUG-102242
Change-Id: Id9981ab6f9514535e1409bec18068790833a67a6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmintegration.cpp')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmintegration.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp index c66ca4ce4a..c6bb7f98c9 100644 --- a/src/plugins/platforms/wasm/qwasmintegration.cpp +++ b/src/plugins/platforms/wasm/qwasmintegration.cpp @@ -57,7 +57,7 @@ // this is where EGL headers are pulled in, make sure it is last #include "qwasmscreen.h" - +#include <private/qsimpledrag_p.h> using namespace emscripten; QT_BEGIN_NAMESPACE @@ -176,6 +176,7 @@ QWasmIntegration::QWasmIntegration() visualViewport.call<void>("addEventListener", val("resize"), val::module_property("qtResizeAllScreens")); } + m_drag = new QWasmDrag(); } QWasmIntegration::~QWasmIntegration() @@ -192,6 +193,7 @@ QWasmIntegration::~QWasmIntegration() delete m_desktopServices; if (m_platformInputContext) delete m_platformInputContext; + delete m_drag; for (const auto &elementAndScreen : m_screens) QWindowSystemInterface::handleScreenRemoved(elementAndScreen.second); @@ -374,4 +376,11 @@ quint64 QWasmIntegration::getTimestamp() return emscripten_performance_now(); } +#if QT_CONFIG(draganddrop) +QPlatformDrag *QWasmIntegration::drag() const +{ + return m_drag; +} +#endif // QT_CONFIG(draganddrop) + QT_END_NAMESPACE |