The new webkit delivery with QT5 has a new structure. QWebView, QWebpage, etc. Now included in QtWebKitWidgets.
So, in your code, you need to enable webview as follows:
#include <QtWebKitWidgets/QWebView>
and in your .pro file you need to add:
QT += webkitwidgets
If you really want to make your code forward / backward compatible; I would just check out QT5:
QT+= core gui webkit contains(QT_VERSION, ^5.*) { QT += webkitwidgets } ...
and then in your code:
#if (QT_VERSION < 0x050000) #include <QWebView> #else #include <QtWebKitWidgets/QWebView> #endif
source share