Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.5.1
-
Desktop Linux
Description
To reproduce the problem please run the attached application without shadow build.
Expected result would be:
XMLHttpRequest displays a list of topics and Qt logo is visible.
Current result:
The debugger logs:
- Not allowed to load local resource: file://./qt.png
qrc:/index.html:1 XMLHttpRequest cannot load - http://www.w3schools.com/json/mytutorials.txt. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'qrc://' is therefore not allowed access.
Seems like:
bool enableLocalFileStuff = true;
QWebEngineSettings::globalSettings()->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, enableLocalFileStuff);
QWebEngineSettings::globalSettings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, enableLocalFileStuff);
doesn't work.