Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-100055

Webassembly user experience for a new macOS user.



    • macOS


      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.


      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.













        Issue Links

          For Gerrit Dashboard: QTBUG-100055
          # Subject Branch Project Status CR V



              portale Alessandro Portale
              javihria Jarko Vihriälä
              0 Vote for this issue
              1 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes