I know this is deprecated, but you can do it by changing the QWebPage settings:
auto settings = page.settings();
settings->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls,true);
settings->setAttribute(QWebSettings::LocalContentCanAccessFileUrls,true);
source
share