Qt WebEngine Platform Notes
Building Qt WebEngine from Source
Static builds are not supported.
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 module:
The tests for skipping the Qt WebEngine build are located in the qtwebengine
repository, in the tools\qmake\mkspecs
subdirectory. They can be found by searching for skipBuild
.
All Platforms
On all platforms, the following tools are required:
- Python 2.7.5 or later. Python 3 is not supported.
- Bison, Flex
- GPerf
Windows
On Windows, Visual Studio 2015 and Windows 10 SDK are required.
Linux
On Linux, Clang or GCC version 4.7 or later is required. Supported configurations are linux-g++
and linux-clang
.
Qt WebEngine requires pkg-config
to detect most of its dependencies. The following pkg-config
files are required:
dbus-1
fontconfig
If Qt was configured for xcb
, the following pkg-config
files are also required:
libdrm
xcomposite
xcursor
xi
xrandr
xscrnsaver
xtst
Further, development packages for khr
and libcap
need to be installed.
macOS
On macOS, the following are required:
Note: Qt WebEngine cannot be built for the 32-bit mode of macOS (using the macx-clang-32
mkspec
).
Mac App Store Compatibility
By default, Qt WebEngine uses private macOS API, which might cause an application to be rejected when submitted to the Mac App Store. To configure Qt WebEngine not to use these API calls, Qt has to be reconfigured with the -appstore-compliant
switch.
However, this will cause some behavioral changes, such as:
- The macOS Kill Ring functionality will no longer work (emacs-like copy pasting).
- Certain Chromium sandboxing cleanup is not done.
- Text areas will be painted with a different style.
- Text fields might be painted with a different style on Mountain Lion (macOS 10.8).
macOS Airplay Support on MacBooks with Dual GPUs
To make Qt WebEngine work correctly when streaming to an AppleTV from a MacBook that supports GPU switching, it is important to add the NSSupportsAutomaticGraphicsSwitching
option to the application Info.plist file, with the value set to YES
. Otherwise rendering issues might occur when creating new web engine view instances after Airplay is switched on or off.
Default QSurfaceFormat OpenGL Profile Support
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.
Sandboxing Support
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 QTWEBENGINE_DISABLE_SANDBOX
environment variable can be set to 1 or alternatively the --no-sandbox
command line argument can be passed to the user application executable.