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. Hello World app with QML & WebAssembly not working
Forum Updated to NodeBB v4.3 + New Features

Hello World app with QML & WebAssembly not working

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
2 Posts 1 Posters 551 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.
  • E Offline
    E Offline
    ericg_97477
    wrote on last edited by
    #1

    I found Developing Web apps using QML and Qt for WebAssembly which is a nice tutorial.

    I successfully completed the steps:

    $ ~/qt/5.15.2/wasm_32/bin/qmake ..
    $ make
    

    As near as I can tell, everything built successfully without error.

    however, when I went to run, I got:

    $ emrun — browser=firefox *.html
    Starting browser: open http://localhost:6931/—?browser=firefox&default.html
    The file /Users/ericg/depot_qt/default/build/http:/localhost:6931/—?browser=firefox&default.html does not exist.
    
    $ ls -la
    total 33776
    drwxr-xr-x  16 ericg  staff       512 Oct 10 20:43 .
    drwxr-xr-x  10 ericg  staff       320 Oct 10 20:36 ..
    -rw-r--r--   1 ericg  staff       513 Oct 10 20:37 .qmake.stash
    -rw-r--r--   1 ericg  staff     49028 Oct 10 20:41 Makefile
    -rw-r--r--@  1 ericg  staff      3229 Oct 10 20:41 default.html
    -rw-r--r--   1 ericg  staff    333625 Oct 10 20:43 default.js
    -rw-r--r--   1 ericg  staff       449 Oct 10 20:37 default.js_plugin_import.cpp
    -rw-r--r--   1 ericg  staff      1259 Oct 10 20:41 default.js_plugin_import.o
    -rw-r--r--   1 ericg  staff       270 Oct 10 20:37 default.js_qml_plugin_import.cpp
    -rw-r--r--   1 ericg  staff       848 Oct 10 20:41 default.js_qml_plugin_import.o
    -rw-r--r--   1 ericg  staff  16544459 Oct 10 20:43 default.wasm
    -rw-r--r--   1 ericg  staff      2455 Oct 10 20:41 main.o
    -rw-r--r--   1 ericg  staff      3703 Oct 10 20:41 qrc_qml.cpp
    -rw-r--r--   1 ericg  staff      1510 Oct 10 20:41 qrc_qml.o
    -rw-r--r--   1 ericg  staff     21742 Oct 10 20:41 qtloader.js
    -rw-r--r--   1 ericg  staff      3047 Oct 10 20:41 qtlogo.svg
    

    and nothing comes up.

    Any idea on what I did wrong?

    E 1 Reply Last reply
    0
    • E ericg_97477

      I found Developing Web apps using QML and Qt for WebAssembly which is a nice tutorial.

      I successfully completed the steps:

      $ ~/qt/5.15.2/wasm_32/bin/qmake ..
      $ make
      

      As near as I can tell, everything built successfully without error.

      however, when I went to run, I got:

      $ emrun — browser=firefox *.html
      Starting browser: open http://localhost:6931/—?browser=firefox&default.html
      The file /Users/ericg/depot_qt/default/build/http:/localhost:6931/—?browser=firefox&default.html does not exist.
      
      $ ls -la
      total 33776
      drwxr-xr-x  16 ericg  staff       512 Oct 10 20:43 .
      drwxr-xr-x  10 ericg  staff       320 Oct 10 20:36 ..
      -rw-r--r--   1 ericg  staff       513 Oct 10 20:37 .qmake.stash
      -rw-r--r--   1 ericg  staff     49028 Oct 10 20:41 Makefile
      -rw-r--r--@  1 ericg  staff      3229 Oct 10 20:41 default.html
      -rw-r--r--   1 ericg  staff    333625 Oct 10 20:43 default.js
      -rw-r--r--   1 ericg  staff       449 Oct 10 20:37 default.js_plugin_import.cpp
      -rw-r--r--   1 ericg  staff      1259 Oct 10 20:41 default.js_plugin_import.o
      -rw-r--r--   1 ericg  staff       270 Oct 10 20:37 default.js_qml_plugin_import.cpp
      -rw-r--r--   1 ericg  staff       848 Oct 10 20:41 default.js_qml_plugin_import.o
      -rw-r--r--   1 ericg  staff  16544459 Oct 10 20:43 default.wasm
      -rw-r--r--   1 ericg  staff      2455 Oct 10 20:41 main.o
      -rw-r--r--   1 ericg  staff      3703 Oct 10 20:41 qrc_qml.cpp
      -rw-r--r--   1 ericg  staff      1510 Oct 10 20:41 qrc_qml.o
      -rw-r--r--   1 ericg  staff     21742 Oct 10 20:41 qtloader.js
      -rw-r--r--   1 ericg  staff      3047 Oct 10 20:41 qtlogo.svg
      

      and nothing comes up.

      Any idea on what I did wrong?

      E Offline
      E Offline
      ericg_97477
      wrote on last edited by
      #2

      @ericg_97477

      I ended up trying an alternate way to use emrun...

      $ emrun --no_browser --port 8080 ./default.html
      Web server root directory: /Users/ericg/depot_qt/default/build
      Now listening at http://0.0.0.0:8080/
      

      I then went to http://0.0.0.0:8080/ in the browser. I was shown the expected page:

      Directory listing for /
      

      with all of the files in my build folder.

      When I clicked on default.html, I saw the QT icon and it a message that it was downloading the program. Eventually, I saw the the hello world message appear.

      I assume I would eventually be able to take control over the loading screen.

      So, that worked.

      Why didn't emrun — browser=firefox *.html?

      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