Cannot open include file: 'QWebView': No such file or directory
Asked Answered
A

4

15

I have followed the instructions on the following page:

http://qt-project.org/wiki/Open_Web_Page_in_QWebView

I added QT += webkit in my pro file and ran qmake, then clean all and compile again. I still get:

error: C1083: Cannot open include file: 'QWebView': No such file or directory

when I add #include <QWebView> in header and cpp file. Any ideas?

Acantho answered 28/9, 2013 at 11:56 Comment(1)
possible duplicate of QWebView library not foundMadi
A
22

I had to add QT += webkit webkitwidgets as well in the pro file for it to work.

Acantho answered 28/9, 2013 at 12:13 Comment(6)
Strange, for me it worked without any further adjustment. Maybe it's the version ? Happy to know it's working.Bootlick
Really? All the other threads just says to run qmake which I did. Can you please point me to the thread where he ran Qmake and it didnt work and the answer was to ALSO include QT += webkit webkitwidgets?Acantho
See my duplicate flag. I left a comment there. There are several threads like this around, and you still have not presented at all why you need webkitwidgets, so it may actually be wrong. Can you provide evidence?Madi
No I cannot "provide evidence". All I can say is that it worked while the thread you linked to did NOT work as a solution for me. I have clearly stated that I already added QT += webkit to the pro file and it did not work. So why are you posting a question and calling it a duplicate when the solution is not the same?Acantho
@Dimo: because you have not even pasted the code, just said: "aww, something does not work, but something made it work". We know it works well... this functionality has been tested since ever. You must be doing something wrong elsewhere.Madi
with CMake this would be adding QtWebKit to the find_package commandTy
L
18

I had to add the libqtwebkit-dev package for my app to compile.

Lu answered 4/4, 2015 at 10:17 Comment(1)
In Ubuntu this is sudo apt install libqtwebkit-devClaritaclarity
P
2

I ran into the same issue on Kubuntu 18.10. My development environment was for Qt5 and I needed to install

libqt5webkit5-dev

apt install libqt5webkit5-dev

Phonology answered 26/12, 2018 at 22:24 Comment(0)
B
0

It works fine for me, on a mac with homebrew install.

Open the Makefile generated by qmake

There should be a variable called INCPATH, and one of the paths listed should end with /include.

List this directory and make it exists, and the many QXXXX directories and header files are present (in particular QWebKit).

If everything seems to be ok, please detail how you are naming the files and what commands are you using to generate the makefile with qmake and then compiling.

Bootlick answered 28/9, 2013 at 12:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.