Running QtWebEngine with C ++

This is my first time testing Qt and want to create a very simple application that loads a website. I want to use Qt WebEngine.

This is my helloworld.pro:

TEMPLATE = app TARGET = hello DEPENDPATH += . INCLUDEPATH += . QT += webenginewidgets SOURCES += hello.cpp 

And this is my hello.cpp

 #include <QApplication> #include <QtWebEngineWidgets/QtWebEngineWidgets> int main(int argc, char *argv[]) { QApplication app(argc, argv); QWebEngineView *view = new QWebEngineView(parent); view->load(QUrl("http://qt-project.org/")); view->show(); return app.exec(); } 

When I try to compile, I get an error:

 Project ERROR: Unknown module(s) in QT: QWebEngineView Project ERROR: Unknown module(s) in QT: webenginewidgets 

I think I know that he cannot find the modules, but looking in the qt documentation seems like the right way to include them.

I am running QtCreator 3.4.2 on Qt 5.5.0.

+7
c ++ qt qt-creator qtwebengine
source share
2 answers

It seems to be supported by only a few compilers right now:

http://wiki.qt.io/QtWebEngine#Q:_On_which_platforms_will_it_run.3F

Try creating one of the configured ones and it should work.

My guess is that basically the Chromium project on which it is built is very complex with a lot of dependencies, and QtWebEngine has not yet been transferred to other compilers.

QtWebKit should still be supported most of the time, but QtWebEngine is what it is all about.

Hope this helps.

+4
source share

Installing Webkit may solve the problem: [apt-get install libqt5webkit5-dev]

+2
source share

All Articles