[Interest] Testing new QML QtWebView 1.0

Sze Howe Koh szehowe.koh at gmail.com
Tue Jan 6 10:15:06 CET 2015


Hi,

On 6 January 2015 at 16:44, Harri Pasanen <harri at mpaja.com> wrote:
>
> On 06/01/2015 08:35, Harri Pasanen wrote:
>
> Hi,
>
> I'm looking at Qt5.4.0/Examples/QtWebView/1.0/webview
> example on Android.
>
> It seems that documentation for it is wrong.
> http://doc.qt.io/qt-5/qml-qtwebkit-webview.html
> mentions
>
> Import Statement: import QtWebKit 3.0
>
> yet the example has
>
> import QtWebView 1.0
>
> (note that QtWebView has a red underline in editor)
>
> Also the doc promises loadHtml() method, but that does not seem to exist.
>
> I'm not sure what is going on, perhaps some confusion with QtQuick1 WebView which I believe was completely different, based on WebKit?
>
> Also, I believe I saw something go by looking like on desktop WebEngine would be used to implement WebView?

I don't think so. Qt WebEngine provides a full web engine based on
Chromium, and is only available .

Qt WebView provides a wrapper for the native web engine on mobile
platforms. This module was introduced mainly because mobile platforms
have security restrictions that prevent Qt WebEngine from running, so
it doesn't make sense to implement Qt WebView in terms of Qt
WebEngine.


> Searching in bugreports is a bit tedious as the name has been recycled, adding to the confusion.

Yeah, recycling the name wasn't such a bright idea... Is it too late
to change this??


> Any guidance?
>
> Harri
>
>
> Ok, I think the correct documentation is here:
>
> http://doc.qt.io/qt-5.4/qml-qtwebview-webview.html
>
> (note that pressing F1 in QC will give you the wrong doc)

Bummer. I'm guessing that's happening because there are two separate
things called "WebView" in Qt, so the F1 just gives you the first one
that it finds. ("WebKit" comes before "WebView" alphabetically).


> I have a question on a note in the docs:
>
> Note: Due to platform limitations overlapping the WebView and other QML components is not supported.
>
> I guess the above means it cannot be in an Item?
> Which means it cannot be in a StackView page, at least if there is anything else on the page besides the WebView, correct?
> Can it be instantiated by Loader?

I'm not sure, as I haven't used this module before. You can test it
quite easily though.


Regards,
Sze-Howe



More information about the Interest mailing list