QWebView problems with Qt 5.0.2 win 64bits under windows 7 [SOLVED]
-
If I run without a QWebView it runs fine when I add a QWebView to the mainwindow.ui I get couple of errors. I did add QT += webkit
as I encountered a similar problem with 4.8 but the problem still persist.mainwindow.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QWebView::QWebView(class QWidget *)" (_imp??0QWebView@@QEAA@PEAVQWidget@@@Z) referenced in function "public: void __cdecl Ui_MainWindow::setupUi(class QMainWindow *)" (?setupUi@Ui_MainWindow@@QEAAXPEAVQMainWindow@@@Z)
mainwindow.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl QWebView::~QWebView(void)" (_imp??1QWebView@@UEAA@XZ) referenced in function "public: virtual void * __cdecl QWebView::`scalar deleting destructor'(unsigned int)" (??_GQWebView@@UEAAPEAXI@Z)
mainwindow.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QWebView::setUrl(class QUrl const &)" (_imp?setUrl@QWebView@@QEAAXAEBVQUrl@@@Z) referenced in function "public: void __cdecl Ui_MainWindow::setupUi(class QMainWindow *)" (?setupUi@Ui_MainWindow@@QEAAXPEAVQMainWindow@@@Z)
mainwindow.obj:-1: error: LNK2001: unresolved external symbol "protected: virtual void __cdecl QWebView::changeEvent(class QEvent *)" (?changeEvent@QWebView@@MEAAXPEAVQEvent@@@Z)
mainwindow.obj:-1: error: LNK2001: unresolved external symbol "protected: virtual void __cdecl QWebView::contextMenuEvent(class QContextMenuEvent *)" (?contextMenuEvent@QWebView@@MEAAXPEAVQContextMenuEvent@@@Z)
mainwindow.obj:-1: error: LNK2001: unresolved external symbol "protected: virtual class QWebView * __cdecl QWebView::createWindow(enum QWebPage::WebWindowType)" (?createWindow@QWebView@@MEAAPEAV1@W4WebWindowType@QWebPage@@@Z)
mainwindow.obj:-1: error: LNK2001: unresolved external symbol "protected: virtual void __cdecl QWebView::dragEnterEvent(class QDragEnterEvent *)" (?dragEnterEvent@QWebView@@MEAAXPEAVQDragEnterEvent@@@Z)
And many other similar link errors
????
Any help would be much apreciated.
Thanks,
-
If removed the win 64 version and installed the mingw47 version instead same problem but different error message
-
Do the following in your PRO file:
QT += webkit webkitwidgets -
Yes you need to add webkitwidgets module in your PRO file because from Qt 5.0 they reworked the modules so that QtWidgets and QtWebkitWidgets are separate modules from QtGui and QtWebkit
-
Thank you that works :)
-
mark post as solved please :)
-
Ok! how do I do that I'm new here.
-
Just edit your first post, and in the title section add [SOLVED]