Hello!
I have a problem regarding QtNetwork.QHttp. It doesn't finish the GET-request, 
although all request have been started (you can see this if you replace the  
requestFinished-Signal with requestStarted).

The output of the script below is:
REQ: 3
FRID = 1
FRID = 2
This means that request 3 is the GET-Request, but only 1 (setProxy I think) 
and 2 (setHost) are finished.

I simply don't know the reason...Is it a bug in PyQt or did I make a mistake?
Thanks in advance,
Jan Holthuis

# CODE STARTS HERE
import sys
from PyQt4 import QtCore, QtGui, QtNetwork

class test(QtGui.QWidget):
        def __init__(self):
                QtGui.QWidget.__init__(self)
                self.httpo = QtNetwork.QHttp()
                self.httpo.setProxy("server",3128,"user","pass")
                self.httpo.setHost("www.google.de")
                self.req_id = self.httpo.get("/images/nav_logo3.png")
                print "REQ: "+str(self.req_id)
                self.connect(self.httpo, QtCore.SIGNAL("requestFinished(int, 
bool)"), 
self.request_finished)
        def request_finished(self,id):
                print "FRID = "+str(id)
                error = False
                if not self.httpo.hasPendingRequests():
                        print "FINISHED"
                if self.req_id == id:
                        if error:
                                print "Error: "+self.httpo.errorString()
                        else:
                                print "Success"
                                print self.httpo.readAll()
app = QtGui.QApplication(sys.argv)
test = test()
test.show()
sys.exit(app.exec_())

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to