QtWebEngine: No such file or directory
Neither the forum search nor Google turned up anything on this.
I'm trying to use QtWebEngine in a QML program, all the latest versions, Windows 7, MSVC-2017 compiler. I checked the WebEngine item when I installed Qt Creator. Here's what I've done in my code:
QTvariable in the project file.
import QtWebEngine 1.7to the QML file.
#include <QtWebEngine>to the main.cpp file.
QtWebEngine::initialize();to the main function, after creating the app.
C1083: Cannot open include file: 'QtWebEngine': No such file or directory.
All of the above was per the instructions in the current QtWebEngine documentation. Then I tried the example WebEngine Quick Nano Browser, and it works fine.
So what's the difference? It uses an earlier version of QtWebEngine, but I'm not getting far enough for that to matter. I found that its main.cpp says
#include <QtWebEngine/qtwebengineglobal.h>. So I changed my application to include that. Now it compiles, but I get a link error on the
But I still can't see any explanation why the
quicknanobrowserproject should find the
initializefunction but my project doesn't. Any ideas?
@pderocco have you re-run
qmakeafter your .pro file changes? In QtCreator Build > Run Qmake. Afterwards I'd do a full rebuild (Build > Rebuild all)
Yes, that seemed to work. The build system doesn't seem to be very good at knowing what depends on what.
Its more about qmake having a cache to avoid re parsing whole of .pro file. It does detect changes (like adding a file ) but
other changes requires a manual update.