[Interest] QML WebView modules

Mark Tucker mark.tucker at airborne.aero
Wed Apr 5 09:51:57 CEST 2017

Hi All,

Thanks for your input.

Seems like due to the Qt version I need to use, I may have to have different QML code for my target Android and Linux platforms.

I have ways of working around this, and this isn't for anything that's going public anyway so I'll figure something out.

Thanks again!


From: Nibedit Dey [mailto:nibedit.dev at gmail.com]
Sent: 05 April 2017 05:50
To: Sze Howe Koh <szehowe.koh at gmail.com>
Cc: Mark Tucker <mark.tucker at airborne.aero>; interest at qt-project.org
Subject: Re: [Interest] QML WebView modules

Dear Sze-Howe,

I haven't worked much in Qt web modules. But below is my understanding.

With Qt 5.5 the Qt WebKit module is deprecated:(https://wiki.qt.io/New-Features-in-Qt-5.5#Deprecated_Functionality)

QWebView uses WebKit as the backend.

QWebEngineView uses Chromium as the backend.

WebView with the same name has been defined in both WebKit and WebEngine. Hence import statement varies.[I believe this is the source of confusion ]

import QtWebKit 3.0
import QtWebView 1.0

In 5.8,
import QtWebView 1.1
QT += qml quick webview
This is useful on mobile platforms such as Android, iOS, and WinRT; especially on iOS, where policy dictates that all web content is displayed using the operating system's web view. [ http://doc.qt.io/qt-5/qtwebview-index.html ]


On Wed, Apr 5, 2017 at 4:20 AM, Sze Howe Koh <szehowe.koh at gmail.com<mailto:szehowe.koh at gmail.com>> wrote:
On 4 April 2017 at 21:39, Nibedit Dey <nibedit.dev at gmail.com<mailto:nibedit.dev at gmail.com>> wrote:
> Hi Mark,
> Qt WebEngine is only supported on desktop platforms.Hence Linux is supported.
> It's not supported on mobile platforms yet .So Qt 5.5.1 doesn't support.
> Refer: https://doc.qt.io/archives/qt-5.5/qtmodules.html
> To use WebView module, in pro file add:
> QT += webkit
> greaterThan(QT_MAJOR_VERSION, 4):QT+=webkitwidgets

The Qt WebView module is not related to WebKit.

Unfortunately, there are two different things named "WebView" in Qt,
which is very confusing:

* http://doc.qt.io/archives/qt-5.5/qml-qtwebview-webview.html
* http://doc.qt.io/archives/qt-5.5/qml-qtwebkit-webview.html

> For WebEngine module add:
> QT += webengine
> In both cases, Linux should be working.
> Regards,
> Nibedit
> .
> ---------- Forwarded message ----------
> From: Mark Tucker <mark.tucker at airborne.aero<mailto:mark.tucker at airborne.aero>>
> Date: Tue, Apr 4, 2017 at 3:56 PM
> Subject: [Interest] QML WebView modules
> To: "interest at qt-project.org<mailto:interest at qt-project.org>" <interest at qt-project.org<mailto:interest at qt-project.org>>
> Hi,
> I'm currently trying to create a QML app that works on both a Linux platform and an Android platform. Due to the nature of my target platforms (embedded systems), I'm limited to Qt 5.5.1 and cannot upgrade.
> Note that my app is pure QML and I cannot write any C++ code to solve this.
> To get the app running on Android, I can put "import QtWebView 1.1" into my QML file imports, and then create a simple WebView component and set its URL and that works.
> That same import doesn't work for me on Linux, however. I can use either "import QtWebKit 3.0" or "import QtWebEngine 1.1" (with the latter, changing my WebView to a WebEngineView too) and I can then see a webview that works with no issues, but neither of those are available on my Android target (nor, from what I understand, will they ever be).
> So, is there a way I can get the QtWebView import working on Linux? I can't seem to figure out how to build it, or if it's even a valid option.
> If not, then I guess that means I'll need to have different QML for both Linux and Android…

When Qt WebView first started as a Tech Preview in Qt 5.4, it only
supported Android and iOS. These platforms were chosen specifically
because Qt WebKit and Qt WebEngine can't run on them.

In later releases, support for desktop platforms was added to Qt
WebView, but I'm not exactly sure which version. Qt 5.5 might be too

> Thanks in advance
> Mark


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170405/2241fd4e/attachment.html>

More information about the Interest mailing list