[PyQt] QWebView and https

Kovid Goyal kovid at kovidgoyal.net
Thu May 27 18:07:27 BST 2010


Look at the sourcecode from the spynner project, its in python and IIRC does
this.

Kovid.

On Thu, May 27, 2010 at 10:59:52AM -0500, alanm wrote:
> On Thursday 27 May 2010 10:41:08 am David Boddie wrote:
> 
> > You should just be able to set the network access manager on the QWebPage
> > returned by the QWebView's page() method. I don't know if this will do
> > everything you need.
> > 
> > I'm curious about the need to subclass QNetworkAccessManager. I would have
> > thought that simply connecting the sslErrors signal to a slot and calling
> > the ignoreSslErrors() method of the QNetworkReply object passes to it would
> > do what you need. Reimplementing the sslErrors signal in a subclass may not
> > work as you might expect.
> 
> David, thanks for your response.  I've tried both of these approaches, and so 
> far nothing works.  What's really frustrating is it just fails silently, never 
> loading the page, so I'm not sure where I'm going wrong.
> 
> I got the approach of subclassing QNetworkAccessManager from trying to make 
> sense of the arora sourcecode with my limited c++ comprehension.  I'm open to 
> any suggestion, as long as I can make it work; if my approach seems strange 
> it's because I'm flailing around ineptly looking for an answer. :-)
> 
> Here's the code I tried based on your second suggestion:
> 
>         self.connect (self.myWebview.page().networkAccessManager(), 
> SIGNAL("sslErrors(QNetworkReply, QList)"), self.sslErrorHandler)
> 
>     def sslErrorHandler(self, reply, errorList):
>         reply.ignoreSslErrors()
>         print errorList
>         return
> 
> Is that correct?  The first statement is called in the __init__() function of 
> the mainwindow widget, self.myWebview is just a QWebView().
> 
> I would be extremely grateful if anyone could provide a simple working 
> example.
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> !DSPAM:3,4bfe975122499873516082!
> 
> 

-- 
_____________________________________

Dr. Kovid Goyal 
http://www.kovidgoyal.net
http://calibre-ebook.com
_____________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100527/00866359/attachment.pgp>


More information about the PyQt mailing list