0

I have installed the Qt SDK and I am trying to make a basic web browser using their supposed QtWebKit though it's not in the include list and I am not sure how to include the relevant header/includes to get this show on the road?

Build error: "Cannot open include file: 'QtWebKit': No such file or directory".

Sorry if this is a basic question but I don't have much experience with C++.

user2428118
  • 7,935
  • 4
  • 45
  • 72
Kal
  • 2,239
  • 6
  • 36
  • 74

2 Answers2

2

By default, webkit is not included.

If using qmake, you should add this line to the .pro file.

QT += network webkit
Yuan
  • 1,147
  • 11
  • 16
  • Added that to the pro and ran qmake from inside the QCreator and got this error? error: Unknown module(s) in QT: webkit – Kal Nov 22 '12 at 15:29
  • Can you open the example 'fancy browser', build and run it? Which Qt SDK did you use? – Yuan Nov 23 '12 at 03:44
  • My project has `QT += network webkit` but I get the same error. The error happens with the fancy browser example as well. Any ideas? – trusktr Jan 02 '13 at 07:08
  • I just tried the wolfenqt example from the Qt's gitorious repo, and I'm getting a similar error: `'QGraphicsWebView': No such file or directory`. – trusktr Jan 02 '13 at 07:31
2

To anyone using Qt 5 or recently releases. This has slightly changed.

You now need to add webkitwidgets to your .pro file. Here's what mine looks like

QT += core gui webkitwidgets
mdoran3844
  • 688
  • 6
  • 14