Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. QML in Qt 5.15.2 Webassembly
Forum Updated to NodeBB v4.3 + New Features

QML in Qt 5.15.2 Webassembly

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
5 Posts 2 Posters 631 Views 1 Watching
  • 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.
  • N Offline
    N Offline
    nagyimre
    wrote on last edited by
    #1

    Hi,

    I am trying to make QML (with QQuickView) working in Qt 5.15.2, but without success. I cannot create QQuickView since it block the main thread or cannot be created from a background thread.

    I know that WASM is a moving platform and the community is already focusing on 6.x, I just want to know, that technically it is possible at all to use QML in Qt 5.15.x WASM, or am I chasing ghosts? (Like it should not work at all)

    I found a lot of QML/WASM examples (pizza, slate, Sensortag), but I think they were made with previous EMSDK/Qt versions.

    So. is it possible at all?

    Thanks,
    I.

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

      It should work, the scenegraph/openglunderqml example which uses QQuickView works fine. How are you configuring Qt?

      https://s3.eu-west-2.amazonaws.com/wasm-qt-examples/last/qtdeclarative/openglunderqml/openglunderqml.html

      https://s3.eu-west-2.amazonaws.com/wasm-qt-examples/last/index.html

      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
      0
      • N Offline
        N Offline
        nagyimre
        wrote on last edited by
        #3

        Qt: 5.15.2
        EMSDK: 2.0.6

        ./configure -xplatform wasm-emscripten -release -static
        -prefix /usr/local/QTWASM2
        -nomake tests -nomake examples
        -no-dbus -no-headersclean
        -no-warnings-are-errors
        -skip location
        -skip qtmultimedia
        -skip qtquick3d
        -opensource -confirm-license
        -feature-thread
        -no-feature-tooltip
        -feature-openssl
        -openssl-linked
        -I$ROOT/openssl
        -I$ROOT/openssl/include
        -L$ROOT/openssl

        1 Reply Last reply
        0
        • N Offline
          N Offline
          nagyimre
          wrote on last edited by
          #4

          I also check with EMSDK 1.38.9 today, to make sure I am aligned to Qt recommendations.

          1 Reply Last reply
          0
          • N Offline
            N Offline
            nagyimre
            wrote on last edited by
            #5

            Tested:

            EMSDK 1.38.9: OpenSSL cannot be compiled, since the packed gcc is older than requested
            EMSDK 1.39.16: Could compile but become frozen.
            EMSDK 2.0.6: Compiled, but every time I add QQuickView *view = new QQuickView(), the console log says:

            -- constructing QQuickView
            qtloader.js:382 Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-
            on-the-main-browser-thread

            and the execution hangs.

            It is possible that I oversee something, but every other modules are fine: multithreading is running, QGraphicsScene is there and works fine. I have only issue with this QML part.

            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