Build applications for the Web | Qt Creator Documentation

- Qt Creator Documentation
- Build applications for the Web
- Qt Creator 17.0.1

How To

# 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 > SDKs > 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`.

4. Go to Preferences > Kits.

5. In Build device, select Desktop as the device type.
6. In Run device, select WebAssembly Runtime as the device type.
7. If Emscripten Compiler was not automatically set for both C++ and C, check that emscripten is set up correctly.
8. In Qt version, select a Qt for WebAssembly version.

See also Run applications in a web browser.

How To