‘QWebView’ does not name a type
-
wrote on 10 Jun 2015, 17:17 last edited by
Hello
I get error
error: ‘QWebView’ does not name a type
although I have
#include <QtWebView/QtWebView>
what does not work:
#include<QWebView>
Ubuntu 14.04 OS
I use QT5 with VTK 6 if this is needed.
-
Hi,
If you are thinking about the QtWebView module, did you add:
QT += webview
to your pro file ?
-
Hi,
If you are thinking about the QtWebView module, did you add:
QT += webview
to your pro file ?
-
So your are using the QWebView from webkit, IIRC, you would also need the webkitwidgets module
-
Hello
I get error
error: ‘QWebView’ does not name a type
although I have
#include <QtWebView/QtWebView>
what does not work:
#include<QWebView>
Ubuntu 14.04 OS
I use QT5 with VTK 6 if this is needed.
Hi @Jan,
It is confusing, but "QWebView" does not come from "Qt WebView". Instead, it comes from "Qt WebKit Widgets", like @SGaist said.
Qt WebView is mainly for mobile platforms to use the native web engine.
-
wrote on 11 Jun 2015, 06:28 last edited by
Thanks for the help, I will test out (right now I do not have this setup anymore). Just one more quick question:
the module name is WebKitWidgets? Sofind_package (Qt5 REQUIRED COMPONENTS Widgets Core WebKitWidgets)
will work?
and then in the include:#include <QtWebKitWidgets>
Thanks alot
-
Thanks for the help, I will test out (right now I do not have this setup anymore). Just one more quick question:
the module name is WebKitWidgets? Sofind_package (Qt5 REQUIRED COMPONENTS Widgets Core WebKitWidgets)
will work?
and then in the include:#include <QtWebKitWidgets>
Thanks alot
@Jan said:
the module name is WebKitWidgets? So
find_package (Qt5 REQUIRED COMPONENTS Widgets Core WebKitWidgets)
will work?
I'm not sure, sorry. I don't use CMake.
and then in the include:
#include <QtWebKitWidgets>
No need to include the whole module. Just include the class you want:
#include <QWebView>
1/7