PDA

View Full Version : QWebView unable to load a page when the content-type isn't set



rmccarthy
24th March 2011, 01:01
Hi there,

I'm using a custom web server with a PyQt4 application that embeds a QWebView as a web browser.

I've noticed that certain pages won't load and, by trial and error, found that if I force my web server to always set the content-type to 'text/html' I can get these pages to load.

If I try to load these pages in another web browser (Chrome, Safari or Firefox) they work fine without any alterations to the server.

Is there a way to set a default content-type for a QWebView? or is there another possible solution for this problem other that changing the server?

Thanks in advance,
Rory

rmccarthy
24th March 2011, 17:40
I feel like this must be a security feature or something similar. I've experimented with QWebSettings, but these don't affect the problem.

Is it possible to put the QtWebKit module into a debug/logging mode to see if it outputs anything when one of these pages fail to load?

Cheers,
Rory