[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] QHttp-request not finished
From:       Jan Holthuis <jan () holmek ! de>
Date:       2008-08-18 18:19:25
Message-ID: 200808182019.41805.jan () holmek ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


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_())

["signature.asc" (application/pgp-signature)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic