PDA

View Full Version : QWebview disable security



hsncn
21st April 2016, 20:49
Hi,

I am trying to load some file in QWebView through XMLHttpRequest but unfortunately it is not working since the file source is local (not HTTP). By default Firefox works very well, and in Google Chrome I can achieve this by opening it with argument --disable-web-security , but somehow I cannot manage to make QWebView to allow to load local files with XMLHttpRequest. I have tried many options including set 'LocalContentCanAccessFileUrls' to true, but unfortunately it is not working.

To keep it short, how can disable security in QWebView same as in the case with Google Chrome's --disable-web-security.

I am using QT 5.4.2 / Windows

Thanks.

anda_skoa
21st April 2016, 21:29
Have you set LocalContentCanAccessRemoteUrls?

FileUrls won't help you much, these are obviously also local.

Cheers,
_

hsncn
21st April 2016, 21:52
yes, I have set both 'LocalContentCanAccessRemoteUrls' and 'LocalContentCanAccessFileUrls' to true but doesn't have any affect.