静态构建不被支持。
The requirements for building Qt modules from source are listed separately for each supported platform:
此外,需要以下工具为构建 Qt WebEngine 模块:
On all platforms, the following tools are required at build time:
在 Windows,需要以下额外工具:
注意:
It is not recommended to use tools from
msys2
or
cygwin
to build Qt WebEngine as it may result in build errors.
On Linux, Clang or GCC version 9 or later is required.
Qt WebEngine 要求
pkg-config
以检测其大多数依赖。以下
pkg-config
文件要求:
dbus-1
fontconfig
若 Qt 被配置为
xcb
,以下
pkg-config
文件也是必需的:
libdrm
xcomposite
xcursor
xi
xrandr
xscrnsaver
xtst
在 macOS,需要以下:
注意:
无法为 macOS 的 32 位模式构建 Qt WebEngine (使用
macx-clang-32
mkspec
).
Building Qt WebEngine with earlier Qt versions (down to the last LTS version) is supported. It means that Qt WebEngine 6.4 can be built with Qt 6.2.x, Qt 6.3.x, and Qt 6.4.
要使用早期 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
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.
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 为 Chromium 渲染过程提供开箱即用的沙盒支持。
在 Linux,注意以下限定:
/proc/sys/kernel/unprivileged_userns_clone
to 1.
seccomp-bpf
特征 (内核版本 3.5 或更高版本)。
要明确禁用沙盒,使用以下选项之一:
QTWEBENGINE_DISABLE_SANDBOX
环境变量到 1。
--no-sandbox
命令行自变量,给用户应用程序可执行文件。
QTWEBENGINE_CHROMIUM_FLAGS
to
--no-sandbox
.
更多信息,见 使用命令行参数 .
当在 Docker 容器中运行 Qt WebEngine 范例并浏览内容繁重站点时,可能报告 BUS 错误 (SIGBUS)。通常,这是由于 Docker 运行过小内存空间 (譬如 64MB) 容器导致的。要修复此问题,增加内存空间大小。
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, Qt WebEngine accessibility support is disabled by default on Linux. It can be re-enabled by setting the
QTWEBENGINE_ENABLE_LINUX_ACCESSIBILITY
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 is described in 基于 OpenGL 的窗口全屏 .