Qt WebEngine Platform Notes | Qt WebEngine 5.15.18 (original) (raw)

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 at build time:

Windows

On Windows, the following additional tools are required:

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 vcvarsall.bat amd64_x86.

Linux

On Linux, Clang or GCC version 5 or later is required. Supported configurations are linux-g++, linux-clang and linux-clang-libc++

Qt WebEngine requires pkg-config to detect most of its dependencies. The following pkg-config files are required:

If Qt was configured for xcb, the following pkg-config files are also required:

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).

Note: Universal debug or debug-and-release builds of Qt WebEngine on macOS are not supported in Qt 5 due to memory constraints of the build toolchain. Use the configure options -force-debug-info and -separate-debug-info for a build that can be used with a debugger.

Using Earlier Qt Versions to Build Qt WebEngine

Building Qt WebEngine with earlier Qt versions (down to the last LTS version) is supported. It means that Qt WebEngine 5.15 can be built with Qt 5.12.x, Qt 5.14.x, and Qt 5.15.

To use an earlier Qt version to build Qt Webengine:

  1. Download the qtwebengine sources.
  2. From the earlier Qt version, run qmake && make (&& make install).

Mac App Store Compatibility

Applications using Qt WebEngine are not compatible with the Mac App Store, because:

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, note the following restrictions:

To explicitly disable sandboxing, use one of the following options:

For more information, see Using Command-Line Arguments.

Memory Requirements in Docker Environment

When running Qt Web Engine examples in a Docker container and browsing content-heavy sites, BUS errors (SIGBUS) might be reported. Typically, this is caused by Docker running a container with a too small memory space (such as 64MB). To fix this problem, increase the memory space size.

Accessibility and Performance

Qt WebEngine enables accessibility support for web pages when the following conditions are met:

On some old Linux configurations, accessibility can cause a significant slowdown on large HTML pages.

Because of that, Qt WebEngine accessibility support can be disabled on Linux, by setting the QTWEBENGINE_ENABLE_LINUX_ACCESSIBILITY environment variable to 0.

Popups in Fullscreen Applications on Windows

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 Fullscreen OpenGL Based Windows and QWindowsWindowFunctions::setHasBorderInFullScreen.