From f8e460b9151ee03195dd886c58144b74b01f33f8 Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Mon, 4 Jul 2022 09:57:27 +0200 Subject: Use the local file APIs to save/load files on WASM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QFileDialog::saveFileContent, QFileDialog::getOpenFileContent are now using local file APIs to access files on any browser that passes a feature check. The feature is thoroughly tested using sinon and a new mock library. Task-number: QTBUG-99611 Change-Id: I3dd27a9d21eb143c71ea7db0563f70ac7db3a3ac Reviewed-by: Tor Arne Vestbø Reviewed-by: Morten Johan Sørvig --- src/corelib/platform/wasm/qstdweb_p.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/corelib/platform/wasm/qstdweb_p.h') diff --git a/src/corelib/platform/wasm/qstdweb_p.h b/src/corelib/platform/wasm/qstdweb_p.h index b4b8948b3a..70f58cb85c 100644 --- a/src/corelib/platform/wasm/qstdweb_p.h +++ b/src/corelib/platform/wasm/qstdweb_p.h @@ -91,7 +91,7 @@ namespace qstdweb { int length() const; File item(int index) const; File operator[](int index) const; - emscripten::val val(); + emscripten::val val() const; private: emscripten::val m_fileList = emscripten::val::undefined(); @@ -183,6 +183,12 @@ namespace qstdweb { void all(std::vector promises, PromiseCallbacks callbacks); }; + + inline emscripten::val window() + { + static emscripten::val savedWindow = emscripten::val::global("window"); + return savedWindow; + } } QT_END_NAMESPACE -- cgit v1.2.3