Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QWebView or QWebEngineView

Are there any functional differences between QWebView and QWebEngineView? If I understand correctly, QWebView is webkit, while QWebEngineView is blink. Are there any differences to the programmer? Does one offer more customization of look & feel over the other?

like image 336
graywolf Avatar asked Mar 14 '15 23:03

graywolf


3 Answers

I would give QtWebEngine a try. It is replacing QtWebKit for a reason.

If you control the HTML that is getting rendered, then it probably doesn't hurt to use QWebKit. Just make sure you test your pages beforehand.

QWebView uses WebKit as the backend.

http://doc.qt.io/qt-5/qwebview.html#details

QWebEngineView uses Chromium as the backend.

http://doc.qt.io/qt-5/qwebengineview.html#details

WebKit is what is used in Konqueror on Linux and Rekonq. Its not bad, but its not as robust across general (and often imperfect) web pages/html in my opinion.

Chromium is a much newer, faster and more robust engine.

I don't know all the technical details specifically, but QWebEngine is a big step in the right direction. I've found this mostly from my own experimenting and empirical usage.

To give WebKit a decent try, look at this project and try a variety of pages:

http://qtweb.net/

https://github.com/magist3r/QtWeb

Here is some more info about QtWebEngine v QtWebKit

http://wiki.qt.io/QtWebEngine

http://en.wikipedia.org/wiki/WebKit

http://wiki.qt.io/QtWebKit

like image 70
phyatt Avatar answered Oct 05 '22 15:10

phyatt


As for me I can't see some very important features in QWebEngineView. First of all you can't access to all frames on page, and you can't run JS in all frames. The next one is that you cant use QNetworkAccessManager for control view underline layer. So for now I can't see any solutions for some issues, like this How to disable sound on flashplayer in my custom application? . I want to believe that it is possible to solve it in some way, becouse QWebEngineView works much faster and seems like it have no (or less) memory leak issues then QWebView.

like image 41
Ivan Borshchov Avatar answered Oct 05 '22 15:10

Ivan Borshchov


Framework: WebKit vs WebEngine

There used to be Qt WebKit since 2007 up to version 3. According to this Qt blog and here It is replaced by new Chromium-based web engine which is Qt WebEngine. According to the link Qt WebKit works fine right now, and will continue to do so in the years to come but if you want to have all the latest and greatest HTML5 features available for your application or device, you should consider moving over to Qt WebEngine.

As this blog says: Qt 5.4 also still contains the older Qt WebKit module. Qt WebKit is still supported, but as of Qt 5.4 we consider it done, so no new functionality will be added to it. We are also planning to deprecate Qt WebKit in future releases, as the new Qt WebEngine provides what is needed. In

My Decision: I prefer to go with the latest QtWebEngine specially when I am in the initial stage. If I hit the wall then maybe I revert to the Qt WebKit. QML: WebView vs WebEngineView.

For having a browser item in QML there are two items WebView and WebEngineView.

WebView with the same name has been defined in both WebKit and WebEngine. Documentation for WebView in WebKit is here. It should have the import QtWebKit 3.0.

For using the WebView bound to WebEngine which is mentioned in this documentation, we need to have this import: import QtWebView 1.0. But we will highly likely face an error #5 and #6 which the solutions to debug is states in the link.

I will use the latter WebView i.e the one which is provided by WebEngine. The proof that it is related to WebEngnie is the debug solution to error #5 and #6. From now on, WebView refers to the one offered by WebEngine in this document.

As this blog says: In Qt 5.4, Qt WebView is provided which offers a more limited API to embed the web browser that is native to the underlying operating system for use cases where the full Qt WebEngine isn’t needed, or where it can’t be used because of restrictions coming from the underlying OS. In Qt 5.4, the Qt WebView module supports iOS and Android. It supports embedding the native web engines of the underlying operating system into Qt, and is currently available for Android and iOS. Because of this, Qt WebView also gives a convenient light-weight solution for simple web document integration.

WebEngineView allows QML applications to render regions of dynamic web content. A WebEngineView component may share the screen with other QML components or encompass the full screen as specified within the QML application.It is my choice in applications which are not going to be executed in iOS and Android.

Note: It is According to this blog QtWebView will fall back to using QtWebEngine when possible. In the meantime that they are making more platforms possible with WebView. It is also mentioned as a reply to a QT-Bug that: While we don't have native WebView implementations for the OS X, Window etc. we can fallback to use QtWebEngine

My Decision: WebEngineView in non Android and iOS applications.

like image 21
Siamak Rahimi Avatar answered Oct 05 '22 15:10

Siamak Rahimi