[Solved] QWebSettings::setAttribute crash
-
Program crashes when execute QWebSettings::setAttribute() function.
Qt5.3, Windows 7, Visual Studio 2013
[code]
#include "qwebview.h"
#include <Windows.h>int WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, INT) {
QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
return 0;
}
[/code]Unhandled exception at 0x000007FEDB347E99 (Qt5Gui.dll) in Qt.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
Any idea about the crash?
Fixed
I'm not sure if it's the common case.
I add both the debug and release lib files to Visual Studio(Project property -> Linker -> Input -> Additional Dependencies), which lead to this strange problem. But there is no warning/error in the link stage...
Remove each kind of lib files will fix the issue.
-
QWebSettings::globalSettings() is definitely returning null. What is the context of using directly like this ?
-
Need your favour. How did you solve this ? Can post the answer ? It will help community.