关于qt:如何让QWebView加载外部JPG资源?

How to make QWebView load external JPG resources?

QWebView出于某种奇怪的原因不想加载JPG图像。我该怎么修?


尝试此选项

1
2
3
4
5
/*QWebView * view*/
view->page()->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls,true);
view->page()->settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls,true);
view->page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled,true);
view->page()->settings()->setAttribute(QWebSettings::AutoLoadImages,true);

这可能有帮助