Kasem Anerin
Kasem Anerin

Reputation: 51

QWebView shows raw html in some cases

I'm using the following code.

QWebView *lpView = new QWebView(*%parent_widget%*);
lpView->load(QUrl(*%path_to_html%*));

With some pages it works just fine and shows the rendered page. And on others it shows raw html.

I suspect that the issue is the content of html page but I can't pinpoint what exactly breaks the rendering in QWebView.

Upvotes: 1

Views: 54

Answers (1)

Kasem Anerin
Kasem Anerin

Reputation: 51

The problem was with encoding. Pages that didn't load were in UTF-8 with BOM and QWebViewer expected plain UTF-8.

Upvotes: 1

Related Questions