Build applications for the Web

WebAssembly is a binary format that allows sand-boxed executable code in web pages. This format is nearly as fast as native machine code. It is supported by all major web browsers.

Use Qt for WebAssembly to build your applications in WebAssembly format and deploy and run them on the local web browser. Change the web browser in the project's run settings.

Note: Enable the WebAssembly plugin to use it.

To build applications for the web and run them in a web browser, install Qt for WebAssembly with Qt Online Installer. It automatically adds a build and run kit to Qt Creator.

Set up WebAssembly development environment

To set up the development environment for WebAssembly:

  1. Go to Preferences > Devices > WebAssembly.
  2. In Emscripten SDK path, enter the root directory where you installed emsdk.
  3. Qt Creator configures the Emscripten SDK environment for you if your Qt for WebAssembly version supports the emsdk.

    {Qt for WebAssembly device preferences}

  4. Go to Preferences > Kits.

    {Qt for WebAssembly kit}

  5. If Emscripten Compiler was not automatically set for both C++ and C, check that emscripten is set up correctly.

See also Run applications in a web browser.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.