靜態構建不被支持。
分彆列齣從源代碼構建 Qt 5 模塊的要求,對於各個支持平颱:
此外,需要以下工具為構建 Qt WebEngine 模塊:
跳過 Qt WebEngine 構建的測試位於
qtwebengine
存儲庫,在
tools\qmake\mkspecs
子目錄。可以找到它們通過搜索
skipBuild
.
所有平颱都需要下列工具:
在 Windows,需要以下額外工具:
Qt WebEngine 隻能在帶有 x64 位工具鏈的 64 位 Windows 中進行構建。為構建用於 x86 應用程序的 Qt WebEngine,需要采用 Visual Studio 2017 x64 to x86 交叉編譯工具鏈來配置和編譯 Qt。可以在命令行中設置此工具鏈,通過運行
vcvarsall.bat amd64_x86
.
在 Linux,需要 Clang 或 GCC 第 5 版或更高版本。支持配置
linux-g++
and
linux-clang
.
Qt WebEngine 要求
pkg-config
以檢測其大多數依賴。以下
pkg-config
文件要求:
dbus-1
fontconfig
若 Qt 被配置為
xcb
,以下
pkg-config
文件也是必需的:
libdrm
xcomposite
xcursor
xi
xrandr
xscrnsaver
xtst
進一步,開發包為
khr
and
libcap
需要安裝。
On macOS ,需要下列:
注意:
Qt WebEngine cannot be built for the 32-bit mode of
macOS
(using the
macx-clang-32
mkspec
).
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
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 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.
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
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 for the issue can be found at 基於 OpenGL 的窗口全屏 and QWindowsWindowFunctions::setHasBorderInFullScreen .