Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. WebAssembly - 'QtQuick.Shapes' could not be loaded successfully
QtWS25 Last Chance

WebAssembly - 'QtQuick.Shapes' could not be loaded successfully

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 873 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JW3153
    wrote on last edited by
    #1

    I have noticed that with WebAssembly (5.13.0) the Shapes module doesn't seem to work.

    I have created a basic test wasm app that requires QtQuick.Shapes and although the app builds with emscripten perfectly fine, when running the app all I get is a blank browser window and in the browser console am advised that 'QtQuick.Shapes' could not be loaded.

    Is there something extra that needs to be done the get QtQuick.Shapes to work in WASM?
    I have tested many other QML features is WASM and they all seem to work surprisingly good, it would be disappointing if Shapes isn't possible though.

    Thanks in advance for any advise.

    1 Reply Last reply
    0
    • lorn.potterL Offline
      lorn.potterL Offline
      lorn.potter
      wrote on last edited by
      #2

      The Shapes component depends on the multi-threaded feature, which is still experimental in WebAssembly.
      The default build for Qt WebAssembly is nonthreaded.

      Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
      Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

      1 Reply Last reply
      1
      • J Offline
        J Offline
        JW3153
        wrote on last edited by
        #3

        ahh thanks @lorn-potter that makes sense then.

        The actual browser console error is: QtQuick.Shapes" is not installed.

        I have the very latest version of emscripten installed and this is what I used to build webassembly support for Qt on my Mac.
        As I understand it this should allow me to enables multi-threading (although experimental).

        Do you happen to know how I can enable multi-threading in emscripten so I can test this though QT's Wasm compilation?

        1 Reply Last reply
        0
        • lorn.potterL Offline
          lorn.potterL Offline
          lorn.potter
          wrote on last edited by
          #4

          It seems that they should work on wasm builds. Here is a change to enable them:
          https://codereview.qt-project.org/c/qt/qtdeclarative/+/266295

          Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
          Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

          J 1 Reply Last reply
          2
          • J Offline
            J Offline
            JW3153
            wrote on last edited by
            #5

            @lorn-potter fantastic.

            Thanks for your time to help. I'll make the change and rebuild wasm target and try again and see how I go.

            Appreciate the help.

            1 Reply Last reply
            0
            • lorn.potterL lorn.potter

              It seems that they should work on wasm builds. Here is a change to enable them:
              https://codereview.qt-project.org/c/qt/qtdeclarative/+/266295

              J Offline
              J Offline
              JW3153
              wrote on last edited by
              #6

              @lorn.potter said in WebAssembly - 'QtQuick.Shapes' could not be loaded successfully:

              It seems that they should work on wasm builds. Here is a change to enable them:
              https://codereview.qt-project.org/c/qt/qtdeclarative/+/266295

              Just a quick update that this works now with the change indicated above.
              Starting to love QT+WASM.

              Thanks for your help @lorn-potter

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved