Qt Webasssembly - Pass URL parameter to QML
-
Hello all,
I'm developing a qt app to run on web browser using QtWebAssembly.
Could someone tell me if it is possible to pass parameters from URL to qml ?
For eg.http://localhost:8080/FusionLiteWeb.html?phonenumber=+91xxxxxxx.
I would like to know the way to send +91xxxxxxx from the URL to qml.
Any help is greatly appreciated.
-
There is a change not yet integrated that does just this.
https://codereview.qt-project.org/c/qt/qtbase/+/248624Its a small change to qtloader.js so you don't even need to recompile. as most of the work is already in Emscripten. You can access the arguments the normal way QCoreApplication::arguments()
So a url such as this:
http://192.168.1.106:6931/wasm-args.html?arguments=yes&argument2=noWill receive the arguments like this:
("./this.program", "arguments=yes", "argument2=no") -
Thank you very much. The solution worked.