diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2021-11-25 12:55:10 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2022-02-11 18:15:26 +0100 |
commit | 5958c28d9fbfa4432887e83e97defb76b0dda14d (patch) | |
tree | 9faa26b3110d60f819a19c8ec22895b9280cdbf4 /src/gui/platform | |
parent | 7c54988b1b3b9eb4d2f3650c1ba5ffe97673ca92 (diff) |
wasm: improve qstdweb::EventCallback
We are storing a copy of the this pointer in the constructor,
and later deference it to access EventCallback object
memebers. This makes the class noncopyable: delete
the copy constructor to make sure it isn’t.
Also change the callback API to propagate the event
to the event callback.
Change-Id: Ida4bb192b3e905b260ebeec30293aad71b7d8c49
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/gui/platform')
-rw-r--r-- | src/gui/platform/wasm/qwasmlocalfileaccess.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/platform/wasm/qwasmlocalfileaccess.cpp b/src/gui/platform/wasm/qwasmlocalfileaccess.cpp index 76e9c6c519..cd1c26c72e 100644 --- a/src/gui/platform/wasm/qwasmlocalfileaccess.cpp +++ b/src/gui/platform/wasm/qwasmlocalfileaccess.cpp @@ -96,7 +96,7 @@ void openFileDialog(const std::string &accept, FileSelectMode fileSelectMode, // Note: there is no event in case the user cancels the file dialog. static std::unique_ptr<qstdweb::EventCallback> changeEvent; - auto callback = [=]() { filesSelected(qstdweb::FileList(input["files"])); }; + auto callback = [=](emscripten::val) { filesSelected(qstdweb::FileList(input["files"])); }; changeEvent.reset(new qstdweb::EventCallback(input, "change", callback)); // Activate file input |