Qt webengine install linux

Qt Documentation

Contents

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:

  • Python 2.7.5 or later. Python 3 is not supported.
  • Bison, Flex
  • GPerf
  • Node.js version 8 or later (version 12 or later is recommended)

Windows

On Windows, the following additional tools are required:

  • Visual Studio 2017 version 15.8 or later, or clang-cl version 8 or later
  • Active Template Library (ATL), usually included in the Visual Studio installation
  • Windows 10 SDK version 10.0.19041 or later

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:

  • macOS 10.13 or later
  • Xcode 10.0 or later
  • macOS 10.13 SDK or later

Note: Qt WebEngine cannot be built for the 32-bit mode of macOS (using the macx-clang-32 mkspec ).

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:

  • The Chromium part of the code uses several private API methods, which are prohibited by the App Store.
  • Applications submitted to the App Store must be code-signed with the App Sandbox feature enabled. The App Sandbox feature interferes with Chromium’s own sandbox initialization, which results in Chromium not being properly initialized. This also ties in with the private API usage. Furthermore, standalone Chromium itself is not officially tested with the App Sandbox enabled, and even if work is done to bypass the App Store’s restrictions, that would not guarantee correct behavior of the library.
Читайте также:  Substance painter ��� mac os

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:

  • The kernel has to support the anonymous namespaces feature (kernel version 3.8 or later). However, on Debian, Ubuntu, and other Debian-derived distributions, this feature is off by default. It can be turned on by setting /proc/sys/kernel/unprivileged_userns_clone to 1.
  • The kernel has to support the seccomp-bpf feature (kernel version 3.5 or later).
  • Setuid sandboxes are not supported and are thus disabled.

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

  • Set the QTWEBENGINE_DISABLE_SANDBOX environment variable to 1.
  • Pass the —no-sandbox command line argument to the user application executable.
  • Set QTWEBENGINE_CHROMIUM_FLAGS to —no-sandbox .

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:

  • Qt Core is configured and built with accessibility support enabled.
  • The QPA plugin is notified by the operating system that accessibility should be activated. This happens for example when using a screen reader application on Windows or VoiceOver on macOS.

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.

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.

В© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.

Источник

Qt Documentation

Contents

The way to package and deploy applications varies between operating systems. For Windows and macOS, windeployqt and macdeployqt automate the steps to generate a stand-alone application package.

When manually deploying applications that depend on Qt WebEngine, all the files that are required to run the application have to be included: libraries, QML imports, plugins, and translations.

Читайте также:  Можно ли переустановить windows без флешки

Target Platforms

Qt WebEngine does try to support all Supported Platforms of Qt. However, due to different requirements of Chromium this is not always possible. Known limitations are:

  • Qt WebEngine currently supports only Windows, Linux, and macOS.
  • On Windows, Qt WebEngine only supports Windows Vista or newer as target platform. Due to use of newer API in Chromium, Windows XP is not supported. WinRT is not supported, either.

Deploying Applications Manually

When manually deploying applications that depend on Qt WebEngine, the following files might have to be deployed:

  • Libraries
  • QML imports
  • Qt WebEngine process
  • Resources
  • Translations
  • Audio and video codecs

Deploying Libraries

The following libraries must be deployed with applications that depend on Qt WebEngine:

Deploying QML Imports

If Qt Quick integration is used in the application, the QtWebEngine import directory needs to be deployed.

Deploying Qt WebEngine Processes

Qt WebEngine takes advantage of the multi-process model that the Chromium project offers. The multi-process model requires that the Qt WebEngine Process executable be deployed alongside your application.

The WebEngine process is executed for each QWebEngineView or WebEngineView instance. For example, a browser application with two tabs open should have two separate instances of the process running. This is a common approach used by most modern web engines to provide a stable browsing experience.

At runtime, Qt WebEngine looks for the QtWebEngineProcess executable in the directory that QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) returns. For Qt installations, this is QTDIR/libexec (Linux) or QTDIR\bin (Windows). The path can be changed by defining a qt.conf file, for example. Alternatively, an executable path can be set as a value of the QTWEBENGINEPROCESS_PATH environment variable. On macOS, Qt WebEngine looks for the executable in .app/Helpers/QtWebEngineProcess .

Deploying Resources

Qt WebEngine requires the following resource files:

  • qtwebengine_resources.pak contains the resources needed by Chromium.
  • qtwebengine_devtools_resources.pak contains tools for remote debugging.
  • qtwebengine_resources_100p.pak contains images suitable for low resolution displays.
  • qtwebengine_resources_200p.pak contains images suitable for high DPI displays.
  • icudtl.dat provides support for International Components for Unicode (ICU). It is the Chromium version of ICU, which is not needed if Qt WebEngine was configured to use the system ICU.

Resources are searched from the following locations:

  • On Linux and Windows: the resources directory in the directory specified by QLibraryInfo::location(QLibraryInfo::DataPath)
  • On macOS: .app/Content/Resources

Translations

Locale data (such as en-US.pak ) is searched form the following locations:

  • On macOS: .app/Content/Resources
  • On Linux and Windows: qtwebengine_locales directory in the directory specified by QLibraryInfo::location(QLibraryInfo::TranslationsPath)

JavaScript Files in Qt Resource Files

If your WebEngine application is built using the Qt Quick Compiler, and the application ships JavaScript files inside .qrc resources, and these files are supposed to be loaded from inside HTML pages, make sure to specify the resource files in a QTQUICK_COMPILER_SKIPPED_RESOURCES qmake variable inside your project. This prevents the Qt Quick Compiler from trying to generate C++ code for the corresponding JavaScript code, as well as removing the original JavaScript code from the Qt resources file, which would lead to broken HTML pages. For example:

В© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.

Источник

QtWebEngine/How to Try

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

Читайте также:  Установить screen для linux

The QtWebEngine can’t be build statically. When a static build is started it will just skip over this part with the message «Static builds of QtWebEngine aren’t supported.» and continue with the build.

Contents

Get the code

The source code for QtWebEngine can be found at http://code.qt.io/cgit/qt/qtwebengine.git/ .

Building QtWebengine

While this is hidden away in our build system, the build relies on gyp and ninja (fetched along with the chromium sources) to build chromium, hence a build dependency to python, in addition to the usual Qt5 suspects. You currently need at least Qt 5.4 to build QtWebEngine.

Note: That in case you have the 64-bit Linux host, you need to install an adidtional 32-bit multilib packages (at least: linux-libc-dev:i386, linux-headers-xxx:i386).

Installing dependencies on Ubuntu

sudo apt-get install bison build-essential gperf flex python2 libasound2-dev \ libcups2-dev libdrm-dev libegl1-mesa-dev libnss3-dev libpci-dev libpulse-dev libudev-dev nodejs \ libxtst-dev gyp ninja-build

Installing additional dependencies on Ubuntu 20.04+

(To save a bit time compiling the bundled variants from qtwebengine.git) sudo apt-get install libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev \ libfontconfig1-dev libxss-dev libsrtp0-dev libwebp-dev libjsoncpp-dev libopus-dev libminizip-dev \ libavutil-dev libavformat-dev libavcodec-dev libevent-dev libvpx-dev libsnappy-dev libre2-dev libprotobuf-dev protobuf-compiler

Please note that these libraries need to be installed on other distributions as well, though the package names and the set of libraries that are preinstalled may differ depending on the distribution used.

Installing dependencies on Fedora

sudo yum install «qt5-*»

sudo yum install mesa-libEGL-devel libgcrypt-devel libgcrypt pciutils-devel nss-devel libXtst-devel gperf cups-devel pulseaudio-libs-devel libgudev1-devel systemd-devel libcap-devel alsa-lib-devel flex bison ruby

To build a release build (generally recommended) do: qmake -r CONFIG+=release

Building

In case you cloned Qt WebEngine as a separate module from git, you might need to initialize out the src/3rdparty submodule that contains the Chromium and Ninja code: cd qtwebengine git submodule update —init

Ensure that your $PATH points to a python version 2 binary. Many systems these days use python 3 by default.

Источник

Install Qt Webengine 5.13
on Linux Mint

Qt Webengine 5.13

  • keshavbhatt (keshavnrj) Publisher
  • Development

Qt 5.13.0 full Webengine stack with codecs support (content snap).

This snap is to be consumed by various Qt apps which uses Webengine module. Qt WebEngine provides C++ classes and QML types for rendering HTML, XHTML, and SVG documents, styled using Cascading Style Sheets (CSS) and scripted with JavaScript. HTML documents can be made fully editable by the user through the use of the contenteditable attribute on HTML elements.

Details for Qt Webengine 5.13

Enable snaps on Linux Mint and install Qt Webengine 5.13

Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully.

Snaps are discoverable and installable from the Snap Store, an app store with an audience of millions.

Enable snapd

Snap is available for Linux Mint 18.2 (Sonya), Linux Mint 18.3 (Sylvia), Linux Mint 19 (Tara), Linux Mint 19.1 (Tessa) and the latest release, Linux Mint 20 (Ulyana). You can find out which version of Linux Mint you’re running by opening System info from the Preferences menu.

On Linux Mint 20, /etc/apt/preferences.d/nosnap.pref needs to be removed before Snap can be installed. This can be accomplished from the command line:

To install snap from the Software Manager application, search for snapd and click Install. Alternatively, snapd can be installed from the command line:

Either restart your machine, or log out and in again, to complete the installation.

Install Qt Webengine 5.13

To install Qt Webengine 5.13, simply use the following command:

Источник

Оцените статью