[SOLVED] Display HTML from QRC in WebEngineView
-
I would like to display HTML files (with associated JS and CSS) that get bundled with my application in QRC in a WebEngineView (I'd prefer to use QML, but if necessary I can use widgets). How can I do this? I've tried loading "qrc:/index.html" as the URL in both a QML and widgets based application, and in both cases the web engine assumes index.html is a domain and fails on the DNS lookup.
Where am I going wrong here? Thanks. :)
-
-
Using a qrc:/ url definitely works. I routinely load css and js files into a WebEngineView with urls (inside the html) like "qrc:/blah.js" and setting the url of a WebEngineView to "qrc:/index.html" also works as expected. If it's not working for you, there's some other problem.