qtqt-creatorqwebviewqwebkit

How do I make QtCreator 4.2.2 include webkit related files


I've pretty much tried every proposal on solving this question that's on the entire internet but to no avail.

I'm using Qtcreator 4.2.2 on Windows 10, trying to make a program that must use a webview (of any kind) -- so far, I've tried using the QWebView and QWebKit stuff but it consistently refuses to recognise that I have the modules installed. I've verified that the dll, header and .pri files do exist in the system. I've tried using the MSVC and MinGw compilers, all with the same result; if I add web* to the QT variable in the project file, qmake claims the modules do not exist. None of the web stuff appears in the UI designer; neither for regular forms nor for qml.

How do I fix this? Is there some magic stuff that I have to do, that's not documented anywhere or am I just blind?

Edit: I've successfully created a program using QtCreator packaged in Fedora 26, that uses QWebView.


Solution

  • It has nothing to do with Qt Creator, it just depends on which Qt version you have.

    First Qt WebKit is not distributed since Qt 5.6, it has been replaced by Qt WebEngine.

    Qt WebEngine does not support MinGW, so you are required to use MSVC. (Looking at my Qt installation it seems it is also the case for WebView) See: http://doc.qt.io/qt-5/qtwebengine-platform-notes.html#windows

    Finally, Qt WebEngine is displayed as an optional module in the Qt Maintenance Tool, so you need to explicitly select it.