This is my first dip into QtWebEngineView, using it as a component in my larger PyQt5 app.
There's a situation where I want to be able to show dynamically generated HTML in a preview widget. Things are working fine with QtWebEngineView and I'm using the setHtml()
method to feed a programmatically-created HTML file directly to the widget without saving it to a file first.
However I can't find a way of getting images to display using this method. I've tried qrc:///
URL's with relative paths for the application, file:////
paths for absolute local paths, and so on. Everything I've tried so far has resulted in an invalid src
showing as a broken link.
Is there a way to get locally-stored images to display in a QtWebEngineView that has been populated using setHtml()
?
If so, what syntax should I be using for the img src
tags please?
Are there security restrictions about where the file can be stored, can the file be anywhere on the user's machine or must the files be within the domain of the application's working area etc.?
These images will vary in number so as far as I can tell from the docs, a .qrc resource file isn't going to work for me?
Thanks