[PyQt] Proper use of QtNetworkProxy

jonnobleuk at gmail.com jonnobleuk at gmail.com
Mon Jul 6 22:50:01 BST 2009


I'm trying to point a QtWebkit browser at a proxy (privoxy) so I can filter 
ads. I know the proxy works as i've tested it with other browsers. However, I 
can not get it to work and can not find any info apart from the class docs 
which i've already looked at.

My code i've tried so far is:

        self.proxyIP = "127.0.0.1"
        self.proxyPORT= 8118
        proxy = QNetworkProxy()        
        proxy.setType(QNetworkProxy.HttpProxy)
        proxy.setHostName(self.proxyIP)
        proxy.setPort(self.proxyPORT)
        QNetworkProxy.setApplicationProxy(proxy)

I get no errors, which is good, but it just does absolutely nothing. What am I 
doing wrong or does anybody know of any good docs I could follow?


More information about the PyQt mailing list