The requirements for building Qt 5 modules from source are listed separately for each supported platform:
In addition, the following tools are required for building the Qt WebEngine 模块：
The tests for skipping the Qt WebEngine build are located in the
repository, in the
subdirectory. They can be found by searching for
Qt WebEngine can only be built on 64-bit Windows, with a x64-bit toolchain. For building Qt WebEngine for x86 applications, you need to configure and compile Qt with the Visual Studio 2017 x64 to x86 cross-compile toolchain. This toolchain can be set up on the command line by running
On Linux, Clang or GCC version 5 or later is required. Supported configurations are
Qt WebEngine requires
to detect most of its dependencies. The following
files are required:
If Qt was configured for
, the following
files are also required:
Further, development packages for
need to be installed.
On macOS ，需要下列：
Qt WebEngine cannot be built for the 32-bit mode of
Building Qt WebEngine with earlier Qt versions (down to the last LTS version) is supported. It means that Qt WebEngine 5.11 can be built with Qt 5.9.x, Qt 5.10.x, and Qt 5.11.
要使用早期 Qt 版本构建 Qt Webengine：
qmake && make (&& make install).
Applications using Qt WebEngine are not compatible with the Mac App Store, because:
To make Qt WebEngine work correctly when streaming to an AppleTV from a MacBook that supports GPU switching, it is important to add the
option to the application Info.plist file, with the value set to
. Otherwise rendering issues might occur when creating new web engine view instances after Airplay is switched on or off.
If a new default QSurfaceFormat with a modified OpenGL profile has to be set, it should be set before the application instance is declared, to make sure that all created OpenGL contexts use the same OpenGL profile.
On macOS , if the default QSurfaceFormat is set after the application instance, the application will exit with qFatal (), and print a message that the default QSurfaceFormat should be set before the application instance.
Qt WebEngine provides out-of-the-box sandboxing support for Chromium render processes on Linux and macOS . Sandboxing is currently not supported on Windows due to a limitation in how the sandbox is set up and how it interacts with the host process provided by the Qt WebEngine libraries.
On macOS , there are no special requirements for enabling sandbox support.
On Linux, the kernel has to support the anonymous namespaces feature (kernel version >= 3.8) and seccomp-bpf feature (kernel version >= 3.5). Setuid sandboxes are not supported and are thus disabled.
To explicitly disable sandboxing, the
environment variable can be set to 1 or alternatively the
command line argument can be passed to the user application executable.
Qt WebEngine enables accessibility support for web pages when the following conditions are met:
Due to some limitations, the Linux QPA plugin almost always reports that accessibility should be activated. On big HTML pages, this can cause a significant slowdown in rendering speed.
Because of that, from Qt 5.9 onwards, Qt WebEngine accessibility support is disabled by default on Linux. It can be re-enabled by setting the
environment variable to a non-empty value.
Because of a limitation in the Windows compositor, applications that show a fullscreen web engine view will not properly display popups or other top-level windows. The reason and workaround for the issue can be found at 基于 OpenGL 的窗口全屏 and QWindowsWindowFunctions::setHasBorderInFullScreen .