How does Qt call C++ functions from JavaScript through webassembly?
-
If you mean: how can I call C++ procs from JavaScript/QML embedded in my application?
This works just like on Qt for desktop. See the examples.If you mean: how can I get a wrapper javascript outside your C++ application to call C++ declared inside the WASM, ... Did you look in the qtloader.js generated by the emscripten compiler? You could try but I don't think that's the intention.
From what I understand, I don't think Qt for WASM is intended as a way to speed up a JavaScript client with some extra C++. It's suppose to be a running application with UI in the browser.
If I misunderstood the question, sorry.
-
It is possible to call c/c++ functions from javascript as well as call javascript from c/c++.
Look at
https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html