Project ERROR: Unknown module(s) in QT: webkitwidgets issues

528 views Asked by At

I'm using Qt 5.7.1 and I have problem with undefined QtWebView. I have found and download from the link - https://github.com/annulen/webkit/releases

qtwebkit_tp4_qt57_msvc2015_x86.zip and copy the content of the archive to C:\Qt\5.7\msvc2015. Now it found QtWebView but the problem is with the object:

test.h

QtWebView *mapBrowserView;

Errors:

error: C2143: syntax error: missing ';' before '*'
error: C4430: missing type specifier - int assumed. Note: C++ does not support default-int

0_1504343524118_2017-09-02_121132.png

So it doesn't work. I think installation should be different. How to fix it? Thanks in advance for the help.

It seems I have circular include QtWebView but I included it only once. It's strange.

1

There are 1 answers

0
Cobra91151 On BEST ANSWER

So here is how I have fixed it:

  1. Copy the contents of the archive qtwebkit_tp4_qt57_msvc2015_x86.zip to C:\Qt\5.7\msvc2015;
  2. Include webkitwidgets to .pro file;
  3. Include #include <QtWebKitWidgets/QWebView>
  4. Initialized the QWebView *mapBrowserView; object;

Now it's all compile and work.