Webkit2 and V8 Engine for QtWebKit



  • Hi,

    I'm trying to take baby steps in QtWebKit. With respect to the forums and threads, it looks like QtWebKitWidgets is using WebKit1 and QML is using WebKit2. Also, the Javascript engine is something called V4VM.

    Now my questions are:

    1. Will it be possible to use WebKit2 for QtWebkitWidgets. If yes, what will be cost of it (in terms of anything that comes to your mind). I'm novice in Qt and Webkit both to estimate the cost. Will it be just few flag settings to get this into working? Do we need to write glue layer? or should i understand the QtWebKit Architecture and Webkit1, Webkit2 architecture and carefully write pieces?

    2. Regarding the javascript engine, QtWebKit abandoned V8. As v8 is targetted for browser engines which is different usecase from QtWebkit. Incase if I want to get v8 back and try it out, can I just enable it again? or is it possible to get latest v8 and replace v4vm?

    Thanks a lot!


  • Moderators

    Hi, and welcome to the Qt Dev Net!

    May I ask what you wish to achieve through Qt WebKit?

    Qt WebKit is being deprecated. If you simply want to learn how to make web apps in Qt, I recommend using Qt WebEngine instead. It is based on Chromium instead of WebKit.

    Download the "Qt 5.4 beta":http://download.qt-project.org/development_releases/qt/5.4/5.4.0-beta/ to start using Qt WebEngine (the final version will be released in about a month).

    If you want to create and distribute an actual web app, you'll need to come up with a list of requirements first. Then, check whether Qt WebEngine can support your requirements yet (and fall back to Qt WebKit if it can't).

    [quote author="paulzwerky87" date="1416684358"]it looks like QtWebKitWidgets is using WebKit1 and QML is using WebKit2.[/quote]Correct.

    But just to clarify some terminology:

    • "QML":http://qt-project.org/doc/qt-5/qmlapplications.html is a programming language.
    • Qt provides both a C++ API and a QML API for WebKit-based applications.
      ** The C++ module is called "Qt WebKit Widgets"
      ** The QML module is simply called "Qt WebKit".
    • QML is used outside of Qt WebKit too.

    [quote author="paulzwerky87" date="1416684358"]Also, the Javascript engine is something called V4VM.[/quote]Not quite. V4VM is only used in the QML engine to run QML apps. It is not used by Qt WebKit to run web apps.

    If you use the QML API to write a Qt WebKit program, you will be running two different (and independent) JavaScript engines -- one for interpreting QML code, one for interpreting browser client code.

    [quote author="paulzwerky87" date="1416684358"]1. Will it be possible to use WebKit2 for QtWebkitWidgets. If yes, what will be cost of it (in terms of anything that comes to your mind). I'm novice in Qt and Webkit both to estimate the cost. Will it be just few flag settings to get this into working? Do we need to write glue layer? or should i understand the QtWebKit Architecture and Webkit1, Webkit2 architecture and carefully write pieces?[/quote]It would involve extensively modifying the source code and then recompiling Qt WebKit Widgets itself. The effort required is enormous -- that's why the Qt developers didn't port Qt WebKit Widgets to WebKit2. I definitely don't recommend taking this path.



  • Thank you very much for the detailed answers which calrified most of the doubts i had.

    The reason why I asked in particular about QtWebKit is that we might have some legacy applications using it. I'm worried how can we apply this massive technology shift to the existing applications. This is also an issue with the QtWebKitBridge which doesn't support webkit2. As far as I found, they say that QtWebKitBridge has deep roots in the webkit1 and can't be pulled out. And the alternate would be to use experimental QWebChannel.


Log in to reply
 

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