Which one to use: QtWebView and QtWebEngine



  • We have a QT widgets based application for mac and windows platforms. Now we want to have web view loads a local .html on the side of our own rendered content. In the beginning I tried a QWebEngineView however the way it uses for rendering seems have conflict with our own content rendering, which results in our own content not showing up. So I'm thinking of using QtWebView instead. However don't know whether it doable or not.

    After reading the documentation I still don't have a clear picture in mind.
    http://doc.qt.io/qt-5/qtwebview-index.html
    http://doc.qt.io/qt-5/qtwebengine-index.html

    Could someone helps me get a general idea of: what are the differences between QtWebView and QtWebEngine? What are the pros and cons and limitations? Can QtWebView be used in a widgets based application?

    Thanks.


  • Lifetime Qt Champion

    Hi,

    The QtWebView module provides a wrapper around platform provided web views which AFAIK, currently, excludes Windows which doesn't provide such a component.

    QtWebEngine is a full featured web browser stack.



  • Hi,

    So that means we can't use QtWebView for windows, right?


  • Lifetime Qt Champion

    After a check at the current version (5.9). It can be used through the QtWebEngine module if available thus it makes it useable on Windows also but only the Visual Studio version since QtWebEngine can't be build with MinGW (well the chromium part underneath).



  • Hi,

    Sorry I'm new and may have some confusions about Qt.

    May I ask is it possible using QtWebView in a widget base application instead of QML? I can't find any example of this kind.

    Also is QtWebView newly introduced in 5.9 or it already exits in 5.4? Because I can't find any doc for QtWebView in 5.4.

    And I don't quite understand what do you mean by "can be used through the QtWebEngine module", could you please explain more about it or provide an example?

    Thanks a lot!


  • Lifetime Qt Champion

    AFAIK, not directly but you can use QQuickWidget.

    No, it was introduced in 5.6.

    From a quick look at the code, the module is enabled for specific platforms which means that it will use the native web view from said platforms or if the QtWebEngine module is available which means that QtWebView can make use of it as backend on platform that don't provide a native web view component.



  • Hi @SGaist ,

    I got a little confused. Currently I'm working on Mac, in Qt 5.4 libraries there is also a "QtWebView.framework". However QtWebView cannot be used on 5.4? (Since our application is currently based on 5.4 and they don't have a plan upgrade to higher version in short time)

    And just wondering for mac, is there a way to customize a widget based on native web view with can be used for displaying a local html?

    Thanks a lot for answering!


  • Lifetime Qt Champion

    Might be a Technical Preview.

    What customisation do you have in mind ? By the way, you also still have QtWebKit available in this version of Qt.



  • Hi @SGaist ,

    Could you please explain a little more about the use of "Technical Preview"? So if it is a preview, is it possible to experiment with it in 5.4?

    Thanks!


  • Lifetime Qt Champion

    Technical Preview is the state where a module is deemed mature enough for people interested in Qt to test before it gets officially integrated within Qt. However the module might still change in terms of API following testers input.

    So sure, you can use it, but it may have changed between there and the time it was officially integrated with Qt.



  • Thank you very much!!


  • Lifetime Qt Champion

    You welcome !

    If that answers your question, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.