0
votes

I'm migrating project from MFC to Qt now, and it's using embedded web browser, which displays local (resource) html-page. Local page is displayed fine, no problems. But i have a problem to set html content to child tag. QWebView can't display external images set via javascript $("#").html() - only text and local (resource) images are displayed. In MFC version with IE webview the same script works fine.

I've tried to use QWebElement::setInnerXml, but result is the same: only local content is displayed.

After that i've tried to use QWebFrame::setHtml, but after call app crashes somewhere in QWebPuginDatabase::searchPathes, despite that i'm calling QWebFrame::setHtml from main thread.

Did anyone meet the same problem? Has anyone solution to resolve my problem?

Thank you

1

1 Answers

1
votes

You may need to change a setting, try:

QWebSettings::globalSettings()->setAttribute(
    QWebSettings::LocalContentCanAccessRemoteUrls, true);

The QWebSettings documentation describes the attribute as (emphasis mine):

Specifies whether locally loaded documents are allowed to access remote urls. This is disabled by default. For more information about security origins and local vs. remote content see QWebSecurityOrigin.