Tuesday, July 5, 2016

Two Ways To Compile QtWebKit With Qt 5.6 on Windows with Visual Studio


This is my first post outside of PHP SOAP programming tips. I have been working a lot of recent on Qt/C++ applications where I have utilized most of my experience in php soap in building core soap libraries for Qt/C++. This post will focus on compiling QtWebKit for Qt 5.6 which I believe most Qt/C++ programmers will find useful as they transit from Qt 5.5 to Qt 5.6.

Qt WebKit (Qt port of WebKit) was removed from Qt 5.6 in favour of Qt WebEngine. WebEngine is based on Chromium from Google and it seems faster, more dynamic with a robust engine. Chromium also offers lots of great features which Qt can simply use out of the box. The Qt team has tried to ensure that moving from Qt Webkit to Qt WebEngine is as seamless as possible.
However, despite these efforts from Qt team, the following features in QtWebKit are currently not supported in QtWebEngine 5.6:
  1. DOM manipulation through QWebElement APIs
  2. Cross platforms export of HTML to PDF
  3. Using QObject instances in web applications through QObject bridge

In addition, QtWebEngine is not supported on Android, iOS and MinGW.
You can check qt site for a complete list of unsupported features in QtWebEngine.

Based on these unavailable features in QtWebEngine it is close to impossible to port some existing QtWebkit codes to QtWebEngine. Qt page will advise you to stick with Qt5.5 if you really need to use QtWebKit. But then, you will miss out of the new features in Qt5.6. The next option is to compile QtWebKit with Qt5.6.

Compiling QtWebKit with Qt5.6 is very tricky and delicate because the entire build process can fail if you miss a single step. There seems to be no easy tutorial online on how to go about this. But after many days of failed attempts and persistence I finally build Qt5.6 from source with QtWebKit using Visual Studio 2015.

There are two ways you can actually build QtWebkit for Qt5.6 with MSVC.
  1. From both QtWebkit + Qt5.6 source
  2. From QtWebkit source alone with existing Qt5.6 toolkit.
Please find below links on detailed explanations of the possible errors you may encounter during the build process and how to resolve them. 


No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...