Details
-
User Story
-
Resolution: Unresolved
-
P2: Important
-
6.3.0 Alpha
-
None
Description
So, took the Qt 6.3.0 WebAssembly for a spin in order to try some things out. This is a complete rundown of all the things that happened there.
1.Installation
Installed WASM support through the installer:
All good there. Did not encounter anything weird except that I did not install macOS support but eventually it appeared on my desktop:
2. First application
Started Qt Creator and did not see any modals pointing out about my incomplete setup (although there was one). Created a simple QML application and did not see it runnable:
Okay, then discovered there was some notice in the banner:
Clicked that and was brought to the setup of the WASM kit. See https://bugreports.qt.io/browse/QTCREATORBUG-26894
3. Setup of the WASM kit
Got the dialog where to set WASM root:
Of course I did not have emscriptem installed , so clicked on the 'installed Emscripten SDK' page did not follow them all as remembered there was something also.. so came back and opened the latter link only to discover I did have a kit (Qt 6) that was not listed. Took the last listed item:
So we know we need 1.39.8, right? Proceeded to setup of Emscripten SDK on the previous link. As important notice, installing is not sufficient, you need to activate the SDK version too. See
4. Running the application
So came back to my project and still it does not show play icon green so quit the Qt Creator and started it again. After opening my project, Qt Creator shows it can run the app, great!
Okay, click the icon and compilation starts...but starting the app fails with:
Hmm.. so something off with QML stuff maybe? Might be due to old emscripten SDK ?
5. Install another emscripten SDK version
Quit Qt Creator, went back to emscripten SDK directory and installed latest version:
./emsdk install latest
and of course activate it
./emsdk activate latest
then quit Qt Creator
6. Run the application with another kit
So, started Qt Creator and opened the project. Same result. So quess this is not emscripten version related thing. Might be something else...
As I know Qt I know there is another paradigm for UIs , called the Widgets. If I would not know this it would be game over at this point, right ?
7. Create a Widgets app
Again, start Qt Creator and select new project. This time select Widgets app.
Guess what! It compiled nicely and after running it I get:
8. Hacker approach
From the error log of the application, one can see that Qt Creator allowed me to create application name and when creating classes for that app in Qt Quick the function name carries the application name (thanks sorvig)
Once that was changed to wasm_quick everything worked well also for QML app.
9. Conclusion
For average joe, Qt with Webassembly is really painful to get started. If you know the steps and understand how e.g. environment variables work things are much easier. See separate tickets attached for this for individual error reports.
Attachments
Issue Links
- is blocked by
-
QTCREATORBUG-26894 Qt Creator should better inform of unfinished kit setups
- Reported
-
QTCREATORBUG-26895 Qt Creator links to old web page regarding wasm setup
- Closed
- resulted in
-
QTBUG-100206 QML app creation breaks if there are illegal characters in the name
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-100055 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
390913,4 | wasm: update install documentation for Qt 6 | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |