Using PyQt4, I create a QWebView and then load it with its setHtml() method. The HTML is displayed correctly in most respects but always using the default sans-serif font.
When the identical HTML plain text is loaded by an external browser e.g. Firefox, it displays in the default serif font. I'd like the webview to do the same.
I've read the doc for QWebView, QWebPage, and QWebSettings and don't see any way to set the default "standard" or "proportional" font, comparable to a browser's preference setting. I looked at QStyleSheets but they don't seem to apply to QWebView/WebPage.
To set the default font for all web pages, use QWebSettings to change the font family for the StandardFont, and to change the font size for the DefaultFontSize: