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. Converting an Existing Project to a Web Application
Forum Update on Monday, May 27th 2025

Converting an Existing Project to a Web Application

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
9 Posts 4 Posters 2.5k 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.
  • R Offline
    R Offline
    Radio1985
    wrote on 25 Aug 2023, 04:28 last edited by
    #1

    Hi All,

    I have an existing desktop QT Widget application created using QT creator. Is it possible to convert ant such application to a Web Application using Web Assembly.

    Thanks!

    S 1 Reply Last reply 25 Aug 2023, 05:45
    0
    • R Radio1985
      25 Aug 2023, 04:28

      Hi All,

      I have an existing desktop QT Widget application created using QT creator. Is it possible to convert ant such application to a Web Application using Web Assembly.

      Thanks!

      S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 25 Aug 2023, 05:45 last edited by
      #2

      Yes, sure. Widgets work in WASM out of the box.

      (Z(:^

      R 1 Reply Last reply 25 Aug 2023, 06:11
      1
      • S sierdzio
        25 Aug 2023, 05:45

        Yes, sure. Widgets work in WASM out of the box.

        R Offline
        R Offline
        Radio1985
        wrote on 25 Aug 2023, 06:11 last edited by Radio1985
        #3

        @sierdzio
        Thanks! Is there any resources I can read on to convert an existing Widget application to a Web Application?

        S 1 Reply Last reply 25 Aug 2023, 07:21
        0
        • R Radio1985
          25 Aug 2023, 06:11

          @sierdzio
          Thanks! Is there any resources I can read on to convert an existing Widget application to a Web Application?

          S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 25 Aug 2023, 07:21 last edited by
          #4

          This is a good place to start: https://doc.qt.io/qt-6/wasm.html

          But in general, just get Qt for WebAssembly, compile your app with it and that's it. If you're not using any unsupported modules it will just work, without needing any adjustments in code.

          (Z(:^

          R 1 Reply Last reply 25 Aug 2023, 07:41
          1
          • S sierdzio
            25 Aug 2023, 07:21

            This is a good place to start: https://doc.qt.io/qt-6/wasm.html

            But in general, just get Qt for WebAssembly, compile your app with it and that's it. If you're not using any unsupported modules it will just work, without needing any adjustments in code.

            R Offline
            R Offline
            Radio1985
            wrote on 25 Aug 2023, 07:41 last edited by Radio1985
            #5

            @sierdzio
            When I create a new project from QT Creator, I get the options of selecting WebAssmebly kits as shown below.
            Can we use this Webassembly kit to convert my application to a web application? If so how can I do it?
            If not what is the purpose of having including this kit into a project?

            700d4a1e-4df2-446c-a3a6-81215cb6444c-image.png

            S 1 Reply Last reply 25 Aug 2023, 08:17
            0
            • R Radio1985
              25 Aug 2023, 07:41

              @sierdzio
              When I create a new project from QT Creator, I get the options of selecting WebAssmebly kits as shown below.
              Can we use this Webassembly kit to convert my application to a web application? If so how can I do it?
              If not what is the purpose of having including this kit into a project?

              700d4a1e-4df2-446c-a3a6-81215cb6444c-image.png

              S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 25 Aug 2023, 08:17 last edited by
              #6

              There is nothing to convert, really. WASM is treated by Qt as a different platform, so it's the same as if you were compiling the project for Android, or Linux, or macOS. It's always the same source code, just compiled and packaged by different tools.

              You need to select a proper Kit for compilation. This tells Qt Creator which compiler to use, which Qt version to link to, and how to deploy the project.

              (Z(:^

              R 1 Reply Last reply 29 Aug 2023, 06:22
              2
              • S sierdzio
                25 Aug 2023, 08:17

                There is nothing to convert, really. WASM is treated by Qt as a different platform, so it's the same as if you were compiling the project for Android, or Linux, or macOS. It's always the same source code, just compiled and packaged by different tools.

                You need to select a proper Kit for compilation. This tells Qt Creator which compiler to use, which Qt version to link to, and how to deploy the project.

                R Offline
                R Offline
                Radio1985
                wrote on 29 Aug 2023, 06:22 last edited by
                #7

                @sierdzio
                Thanks for the information.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SimonSchroeder
                  wrote on 29 Aug 2023, 08:01 last edited by
                  #8

                  I haven't used WebAssembly so far. But the screenshot made me curious: Are there any pointers for using multi-threaded vs. single-thread? Should one prefer one of the other always? Or what would be the selection criteria?

                  R 1 Reply Last reply 29 Aug 2023, 08:11
                  0
                  • S SimonSchroeder
                    29 Aug 2023, 08:01

                    I haven't used WebAssembly so far. But the screenshot made me curious: Are there any pointers for using multi-threaded vs. single-thread? Should one prefer one of the other always? Or what would be the selection criteria?

                    R Offline
                    R Offline
                    RandomGuy
                    wrote on 29 Aug 2023, 08:11 last edited by RandomGuy
                    #9

                    @SimonSchroeder I have been using it internally and it works really well. I went with the single thread approach (without async) as that seems to be the most supported version and for an application that behaves like a website I don't really need threads anyway.

                    There are some things that we need to be careful like not calling code that breaks the Qt event loop like qdialog.exec(). There are also some things that don't work as expected but that I found workarounds for and bug reports have been opened, so they will be fixed in the next versions.

                    https://doc.qt.io/qt-6/wasm.html
                    Is a good place to start reading.

                    Version 6.5.2 seems to work decently well and it will be good to start. You can also check the betas to see how bugs are getting fixed (in case you run into some issue with 6.5.2).

                    1 Reply Last reply
                    1

                    2/9

                    25 Aug 2023, 05:45

                    7 unread
                    • Login

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