diff options
author | Mikolaj Boc <[email protected]> | 2022-12-22 15:31:48 +0100 |
---|---|---|
committer | Mikolaj Boc <[email protected]> | 2023-01-18 02:55:12 +0100 |
commit | 16bf899557febb8c0762e64ce88acf21bc84e334 (patch) | |
tree | 2f0598c71edc24e01dbb156754a8943254ff9b9a /src/plugins/platforms/wasm/qwasmdom.cpp | |
parent | 2e8b75477fdbee53e0cf1266340a8dea6c1718a0 (diff) |
Streamline reading of js DataTransfer object
qwasmclipboard.cpp and qwasmdrag.cpp had the same logic that read
the js DataTransfer object implemented twice with small differences.
Use a single implementation in both.
This also introduces a clearer memory ownership model in the reader
code, and fixes a potential race condition by introducing a cancellation
flag.
Removed the useless QWasmDrag type which was in essence a SimpleDrag
and made the m_drag in QWasmIntegration a smart pointer.
Fixes: QTBUG-109626
Pick-to: 6.5
Change-Id: I5b76dd3b70ab2e5a8364d9a136c970ee8d4fae9c
Reviewed-by: Morten Johan Sørvig <[email protected]>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmdom.cpp')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmdom.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/wasm/qwasmdom.cpp b/src/plugins/platforms/wasm/qwasmdom.cpp index 1573b5bf9c0..f9705f1a1c1 100644 --- a/src/plugins/platforms/wasm/qwasmdom.cpp +++ b/src/plugins/platforms/wasm/qwasmdom.cpp @@ -3,14 +3,18 @@ #include "qwasmdom.h" +#include <QMimeData> #include <QtCore/qpoint.h> #include <QtCore/qrect.h> +#include <QtGui/qimage.h> +#include <private/qstdweb_p.h> #include <utility> QT_BEGIN_NAMESPACE namespace dom { + void syncCSSClassWith(emscripten::val element, std::string cssClassName, bool flag) { if (flag) { @@ -31,6 +35,7 @@ QPoint mapPoint(emscripten::val source, emscripten::val target, const QPoint &po auto offset = sourceBoundingRect.topLeft() - targetBoundingRect.topLeft(); return (point + offset).toPoint(); } + } // namespace dom QT_END_NAMESPACE |