summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmstring.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add QString<->emscripten::val conversion functionsMikolaj Boc2023-01-131-36/+0
| | | | | | | | Following the QRect, add functions converting the QString to native emscripten::val and back: fromJsString, toJsString Change-Id: I2d0625ede3bbf7249e2e91b8de298b5b91df8ba2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-28/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* wasm: use module_property instead of global(“Module”)Morten Sørvig2021-06-221-2/+2
| | | | | | | | | | | | | | Depending on build options, the module can have a different name, or be a non-global object. We were already using module_property in many places, but some were missing. In the case of the clipboard code, there is actually no need to export all of the C++ functions to JavaScript and then resolve them from the module; instead call them directly. Change-Id: I83aa3ad01ad961d48e21f0994e0c205d833cbe8a Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: fix QWasmString::toQString assertion for emscripten 1.39.4Alexandra Cherdantseva2020-01-311-2/+3
| | | | | | | | | | In emscripten 1.39.4 `maxBytesToWrite` argument is required for function `stringToUTF16(str, outPtr, maxBytesToWrite)` Fixes: QTBUG-81728 Change-Id: I634134a30454ae09a9a05593428397b40464b31f Reviewed-by: jian liang <jianliang79@gmail.com> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: fix redundant string conversions between wasm and JavaScriptAlexandra Cherdantseva2020-01-221-0/+61
Avoid redundant conversions from UTF16 to UTF8 to UTF16 with help of new class QWasmString static methods: + QWasmString::fromQString to convert QString to js string using js Module.UTF16ToString + QWasmString::toQString to convert js string to QString using js Module.stringToUTF16 Fixed document.getElementById calls for cavasId with unicode characters. Change-Id: I3fc55bfeb6aeda75fa3acd85d22cea667b542f38 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>