
Originally Posted by
sublimer
I have a string of HTML code with references to the aforementioned file types but when I call setHtml,
You need to set a base url of 'qrc:/' when you call setHtml.
here's a pyQt4 example
import qrc_resources
from PyQt4 import QtCore
from PyQt4.QtWebKit import QWebView
wv = QWebView()
wv.show()
html = "<body><img src='mypicture.png' /></body>"
wv.
setHtml(html, QtCore.
QUrl('qrc:/'))
import qrc_resources
from PyQt4 import QtCore
from PyQt4.QtWebKit import QWebView
wv = QWebView()
wv.show()
html = "<body><img src='mypicture.png' /></body>"
wv.setHtml(html, QtCore.QUrl('qrc:/'))
To copy to clipboard, switch view to plain text mode
incidentally, having a full path of 'qrc:/mypicture.png' within the html also works.
Bookmarks