AnsweredAssumed Answered

webview that displays a local html file?

Question asked by paul.haakma on Jun 12, 2017
Latest reply on Jun 12, 2017 by paul.haakma

Hi all, I wonder if anyone could point me in the right direction...

 

I can successfully create a WebView object, and get it to load a url from the www. But the documentation specifically says: Note: The WebView does not support loading content through the Qt Resource system.

 

WebView QML Type | Qt WebView 5.9 

 

I am wanting to compose, view, load, edit and save an html file locally, but this suggests to me I can't do it using the WebView object.

 

I can read the html file as text, and load it with the loadHtml() method, but it looks like the 'baseUrl' it expects is an online resource, and I can't get it to display any resources (such as image files).

 

How can I interact with a local html file?

 

import QtWebView 1.1
App {
    id: app
    width: 500; height: 500
     WebView{
        id: mywebview
        anchors.fill: parent
    }
}

Outcomes