Doc: Update info about the WebAssembly plugin

The installer now automatically creates build and
run kits.

Change-Id: I75093fb0d06efdb20b4987b456c2a451ce0dce8a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Leena Miettinen
2020-04-02 14:23:14 +02:00
parent f8ec649c99
commit 86b16b6b7d

View File

@@ -44,8 +44,7 @@
You can change the web browser in the project run settings. You can change the web browser in the project run settings.
To build applications for the web and run them in a web browser, you need to To build applications for the web and run them in a web browser, you need to
install Qt for WebAssembly and the tool chain for compiling to WebAssembly, install Qt for WebAssembly and the tool chain for compiling to WebAssembly.
as well as add a build and run kit in \QC.
\section1 Requirements \section1 Requirements
@@ -66,8 +65,13 @@
\section1 Setting Up the Development Environment \section1 Setting Up the Development Environment
To configure \QC for building Qt apps for the web and running them in a You need to install and configure Qt for WebAssembly and the tool chain for
web browser: compiling to WebAssembly. The installer automatically adds a build and run
kit to \QC.
\section2 Setting Up Qt for WebAssembly
To set up Qt for WebAssembly:
\list 1 \list 1
\li Use the Qt maintenance tool to install Qt for WebAssembly and, on \li Use the Qt maintenance tool to install Qt for WebAssembly and, on
@@ -81,17 +85,44 @@
\li On Windows, you have to download and install \c sed, as instructed \li On Windows, you have to download and install \c sed, as instructed
in \l{http://gnuwin32.sourceforge.net/packages/sed.htm} in \l{http://gnuwin32.sourceforge.net/packages/sed.htm}
{sed for Windows}. {sed for Windows}.
\li In \QC, select \uicontrol Help > \uicontrol {About Plugins} > \endlist
\uicontrol {Device Support} > \uicontrol {WebAssembly} to enable
the plugin. \section2 Enabling the WebAssembly Plugin
\li Select \uicontrol {Restart Now} to restart \QC and load the plugin.
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits > To enable the plugin:
\uicontrol {Qt Versions} > \uicontrol Add to add Qt for WebAssembly
(wasm_32).
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits >
\uicontrol Add to add a kit for building applications for the web:
\image qtcreator-kit-webassembly.png "Qt for WebAssembly kit"
\list 1 \list 1
\li In \QC, select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {Device Support} > \uicontrol {WebAssembly}.
\li Select \uicontrol {Restart Now} to restart \QC and load the plugin.
\endlist
\section2 Specifying WebAssembly Settings
To configure \QC for building Qt apps for the web:
\list 1
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits.
\image qtcreator-kit-webassembly.png "Qt for WebAssembly kit"
\li In the \uicontrol Compiler group, \uicontrol {Emscripten Compiler}
should have been automatically detected for both C++ and C. If not,
check that emscripten is set up correctly and your home directory
contains an \c{.emscripten} file.
\li Select \uicontrol Change next to the \uicontrol Environment
field to append the locations where you installed \MinGW and
\c sed to the PATH variable. For example, on Windows:
\c {PATH=C:\Qt\Tools\mingw730_64\bin;C:\Program Files (x86)\GnuWin32\bin;${PATH}}
\li Select \uicontrol Apply to save the changes to the kit.
\endlist
\section2 Adding WebAssembly Kits
The Qt for Web Assembly installation automatically adds build and run kits
to \QC. To add kits:
\list 1
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits >
\uicontrol Add.
\li In the \uicontrol Name field, specify a name for the kit. \li In the \uicontrol Name field, specify a name for the kit.
\li In the \uicontrol {Device type} field, select \li In the \uicontrol {Device type} field, select
\uicontrol {WebAssembly Runtime}. \uicontrol {WebAssembly Runtime}.
@@ -101,10 +132,15 @@
\uicontrol {Emscripten Compiler} for both C and C++. \uicontrol {Emscripten Compiler} for both C and C++.
\li Select \uicontrol Change next to the \uicontrol Environment \li Select \uicontrol Change next to the \uicontrol Environment
field to append the locations where you installed \MinGW and field to append the locations where you installed \MinGW and
\c sed to the PATH variable. For example, on Windows: \c sed to the PATH variable.
\c {PATH=C:\Qt\Tools\mingw730_64\bin;C:\Program Files (x86)\GnuWin32\bin;${PATH}}
\li Select \uicontrol Apply to add the kit. \li Select \uicontrol Apply to add the kit.
\endlist \endlist
\section1 Running Applications in a Web Browser
To run a project:
\list 1
\li Open a project for an application you want to run in a web browser. \li Open a project for an application you want to run in a web browser.
\li Select \uicontrol Projects > \uicontrol {Build & Run}, and then \li Select \uicontrol Projects > \uicontrol {Build & Run}, and then
select the WebAssembly kit as the build and run kit for the project. select the WebAssembly kit as the build and run kit for the project.