Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Can't load local HTML in WebEngineView



  • I'm using QtCreator 4.9.0 on a Mac running 10.13.

    I have a WebEngineView, and a local html file I'd like to load into it.

    When I point the url property to my file:

    url:"../path/to/file.html"
    

    It loads the file, but displays the raw html.

    If I point the url property to a web page (e.g. www.google.com), the page loads correctly.

    What's the secret to getting a local file to load?

    For reference my test file looks like this:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="utf-8">
    	<title> test</title>
    </head>
    
    <body>
    
    <h1>Test</h1>
    
    </body>
    </html>
    

Log in to reply