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

wasm: Exit app with async main() results on runtime error

    XMLWordPrintable

Details

    • WebAssembly
    • fefb1e18b (dev), 4c562f94c (6.5), 7549f7fdb (6.6)

    Description

      Hi,

       

      According to: https://doc.qt.io/qt-6/wasm.html#application-startup-and-the-event-loop

      Particulary this sentence: "Application code then omits making the exec() call, and can shut down Qt cleanly by deleting the top-level window and application objects."

      We can have an application with a async main function and then, when the main window is closed, we delete all application objects and the application should exit fine

       

      I cannot make it to work completly fine with the linked code.

       

      The app is simple:

      • have a main class, subclassing QGuiApplication, creating the QQmlApplicationEngine, loading the qml module
      • have a signal in qml when the button is pushed
      • c++ should delete the qml root object
      • when informed of qml root object deletion, require to delete the main class, thus, cleaning all remaining objects

       

      The application do exit, but with an error, on firefox:

      And on chrome:

      Attachments

        1. CMakeLists.txt
          1 kB
        2. image-2023-08-22-11-42-27-980.png
          image-2023-08-22-11-42-27-980.png
          144 kB
        3. image-2023-08-22-11-44-58-233.png
          image-2023-08-22-11-44-58-233.png
          149 kB
        4. main.cpp
          2 kB
        5. main.h
          0.3 kB
        6. Main.qml
          0.5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            michal Michal Klocek
            qtdel Quentin Deldycke
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes