1

I'm using a simple WebView in my QML file.

WebView {
    anchors.fill: parent
    url: "file:///android_asset/example.html"
}

The problem is, that I'm getting an error about access-control-allow-origin is null. I found a fix for this here, which is using WebView settings property. It seems to be accessible from c++, but I haven't found any way of using this property from qml. So how can I use WebView settings from QML to get rid of the error? I'm using Qt 5.10.

T.Poe
  • 1,949
  • 6
  • 28
  • 59

1 Answers1

-1

Use Qt's resource system, add the file to it, and load the file via

url: "qrc:///android_assets/example.html"

mike510a
  • 2,102
  • 1
  • 11
  • 27