Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-962

Support Qt for Python on WebAssembly

    XMLWordPrintable

Details

    • Epic
    • Resolution: Unresolved
    • P2: Important
    • 6.7
    • None
    • PySide, Shiboken
    • None
    • Support Qt for Python on WebAssembly
    • WebAssembly
    • 53f1f56a3 (6.4), 74b22de59 (dev), a2d56c9fb (6.4), c8b8d0868 (dev), 3d9bc9fb2 (6.4), 4a3f337d0 (dev), 76b9c085d (dev)

    Description

      Motivation

      Since the initial PySide release, we have been getting some questions regarding WebAssembly support, but not so much as other features, that's why this idea was stalled for a long time.

      When Pyodide was out, we got more people asking about support, and with[ the announcement|https://www.youtube.com/watch?v=qKfkCY7cmBQ] of PyScript at PyConUS2022 the demand grew a lot.

      During PyConUS 2022, in one of the PyScript open spaces there was some discussion on bringing PySide to WebAssembly with PyScript. The reason of this, was the perfect timing after the Qt for Python team was researching the CPython interpreter built for WebAssembly (pushed by the effort of some /core/ python devs).

      Because defining a Widget library is one of the future steps for the PyScript project, we know work is already being made with the Toga framework, after the main developer joined Anaconda, at the same time Jupyter Widgets sounds like a nice fit for PyScript as well.

      We know that even those frameworks are really nice and easy to use, they don't cover all the cases Qt has been working on for the last years, and due to Qt popularity and the fact that in 6.4 Qt for WebAssembly is back, it was natural to continue with the efforts to make this possible for Python users.

      Scope

      PySide is a different beast, because it's not written purely in Python due to the Qt/C++ dependency, that's why it's more complicated to make it work.
      Pyodide has shown that it's possible to bring non-pure Python modules to WebAssembly, like numpy and the scientific stack, so it's not an impossible thing to achieve. Besides the 'normal' Pyodide way, there might other approaches to simplify the pacaking of the module, like https://github.com/emscripten-forge/recipes

      But then we need to define the two main use cases we expect:

      1. Expose the PySide6 module to WebAssembly, so we can have an interactive interpreter on a browser being able to import them, and display applications on the same page.
      2. Package PySide6 applications to run as a WebAssembly application on the browser.

      Side discussions

      Attachments

        For Gerrit Dashboard: PYSIDE-962
        # Subject Branch Project Status CR V

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            hakjol Harald Kjølberg (Inactive)
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            8 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are 4 open Gerrit changes