PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 114 - QHttp.get doesn't actually download anything
: QHttp.get doesn't actually download anything
Status: CLOSED INVALID
Product: PySide
Classification: Unclassified
Component: QtNetwork
: HEAD
: All All
: P5 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-01-08 12:25 EET by Tomi Pieviläinen
Modified: 2010-03-03 16:48 EET (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomi Pieviläinen 2010-01-08 12:25:03 EET
Steps to reproduce:
Run
"""
import sys
from urlparse import urlparse

from PySide import QtCore, QtGui, QtNetwork

class Test(QtGui.QWidget):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        self.http = QtNetwork.QHttp()
        self.connect(self, QtCore.SIGNAL("requestFinished(int, bool)"),
self.httpFinished)
        parsed = urlparse("http://www.ietf.org/download/rfc-index.txt")
        self.http.setHost(QtCore.QString(parsed.hostname))#, parsed.port)
        self.file =  QtCore.QFile(QtCore.QString("foobarbaz"))
        if not self.file.open(QtCore.QIODevice.WriteOnly):
            print "What!"
            return
        print "Downloading video %s%s" % (parsed.hostname, parsed.path)
        self.getId = self.http.get(parsed.path, self.file)
        print "Foo!"

    def httpFinished(self, id, error):
        print self.getId, id



if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    mainwindow = Test()
    mainwindow.show()
    sys.exit(app.exec_())
"""

Expected outcome:
The requestFinished signal is sent and the callback runs.

Actual outcome:
The httpFinished never runs, program output stops after "Foo!"
Comment 1 Lauro Moura 2010-01-09 16:56:24 EET
"self.connect(self, QtCore.SIGNAL("requestFinished(int, bool)"),
self.httpFinished)"

Instead of self, the first argument should be self.http. Doing this the example
worked with Pyside from git.

Marking as invalid.