[PyQt] qt-webkit - change browser identification

dboddie at trolltech.com dboddie at trolltech.com
Tue Jan 20 17:38:04 GMT 2009


On Tue Jan 20 16:07:28 GMT 2009, piotr maliński wrote:

> Can QWebView browser identification can be changed? I checked the settings
> class but didn't noticed anything about it.

It seems that you'll need to derive a subclass from QWebPage and reimplement
the userAgentForUrl() method:

http://www.riverbankcomputing.com/static/Docs/PyQt4/html/qwebpage.html#userAgentForUrl

This means that you'll also need to create your own Web page instances and
set them on your QWebView widget rather than using QWebView.load() to open
pages.

David



More information about the PyQt mailing list