View Full Version : It crashes when using QWebView to show a website

7th April 2014, 07:46
I run it on windows 8.1, with Qt 5.1.0, and IDE is Visual Studio 2010 professional.
Here is the code:

#include <QApplication>
#include <QtWebKitWidgets/QWebView>

int main(int argc, char * argv[])
QApplication app(argc, argv);

QWebView view;
view.settings()->setAttribute(QWebSettings::PluginsEnabled, true);
// crash
// OK

return app.exec();

It is OK to show YouTube. It is really weird. I attached the dialog when crash.

9th April 2014, 09:44
it could be so many reasons....
1. what does your .pro file look like? does it have QT += webkit webkitwidgets network ?
2. maybe your build didn't do Webkit properly because of ANGLE or OpenGL with Qt/Visual2010
3. why do you call a QWebView from main? not mainwindow.cpp or dialog.cpp?
4. maybe you should look at the simple web browser program that is an example code.....

9th April 2014, 10:38
The error dialog clearly indicates the problem is related to dereferencing an uninitialized or otherwise invalid pointer. If you want more meaningful information, run the application under a debugger and provide us with the backtrace.