Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Can't load local HTML in WebEngineView
Qt 6.11 is out! See what's new in the release blog

Can't load local HTML in WebEngineView

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 432 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    igor_stravinsky
    wrote on last edited by
    #1

    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>
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved