QNetworkReply objects getting mixed up with other objects in PySide ?

  • I hope this question belongs here and not in one of the other forums or in the BTS - I am seeing a very strange (and very intermittent) issue, where in places where I expect to get other QObject types, I get a QNetworkReply object in PySide 1.1 / Qt 4.7.4 on Ubuntu 11.10.

    I know this sounds strange, but this is the type of errors I see:

    @AttributeError: 'PySide.QtNetwork.QNetworkReply' object has no attribute 'userAgentForUrl'@
    @QMetaObject::invokeMethod: No such method QNetworkReply::repaintRequested(QRect)@
    @Object::connect: No such signal QNetworkReply::loadProgress(int)@
    @Object::connect: No such signal QNetworkReply::unsupportedContent(QNetworkReply*)@

    The errors are not always consistent, but it is always QNetworkReply and QWebPage that are being mixed up in my case. The problem is very intermittent - I am yet unable to get a clear reproduction flow for it.

    Some of these trace to my own code, and some trace to internal Qt operations - but in all of these I expect a QWebPage object and not a QNetworkReply object. In fact the trace to the first error above (AttributeError: 'PySide.QtNetwork.QNetworkReply' object has no attribute 'userAgentForUrl') traces back to something like:

    @ File "/usr/lib/pymodules/python2.7/xxxxx/webpage.py", line 298, in load
    self.mainFrame().load(netRequest, REQUEST_METHOD_MAP[self._request.method])
    AttributeError: 'PySide.QtNetwork.QNetworkReply' object has no attribute 'userAgentForUrl'

    Where 'self' in this case points to an object of QWebPage type (I inherit QWebPage to override some of its methods).

    I have tried searching for this issue and even asked in the PySide IRC channel, but got no response except for a similar report from another user who also told me he got no response.

    Did anyone encounter this, or can speculate if this is a bug in PySide / Qt, or I'm doing something terribly wrong? How can I further debug this?



  • For what is worth this issue seems to be solved after upgrading to PySide 1.2.1.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.