On Mon, Jun 14, 2010 at 4:09 PM, Hugo Parente Lima <[email protected]>wrote:
> On Friday 11 June 2010 12:20:10 Luca Donaggio wrote: > > Looking at the documentation here [1] I figured out tht I could query the > > error status of a QNetworkReply object by calling its meber function > > "error()". > > It turned out that it is actually not possible (with PySide); when > > executing the attached python code, I got this error: > > > > Error calling slot "testNetwork" > > Traceback (most recent call last): > > File "./provanet.py", line 28, in testNetwork > > neterr = netrepl.error() > > TypeError: 'Signal' object is not callable > > > > It seems to me that QNetworkReply.error() meber function is missing and > > it's trying to call the signal (which happens to have the same name) > > instead. > > > > There are two ways to solve this problem: > > 1. The simple one with consist in rename the method to avoid the name clash > with the signal. > > 2. The complicated one, error is a attribute of QNetworkReply, not a > method, > and it is of Signal type, but it have the __call__ operator with > mysteriously > call the error() method. > > Discussing with other PySide developers after read your email we voted for > the > first one for two reasons. It's simpler and it doesn't screw up with Python > introspection. > > We plan to generate the PySide docs using the doc strings in a near future, > and it'll be impossible if we use the second option. We also guess that the > second option could confuse the programmers a bit due to the duality of the > error attribute that sometimes is a method and sometimes is a Signal > object. > > > [1] > > > http://www.pyside.org/docs/pyside/PySide/QtNetwork/QNetworkReply.html#PySid > > e.QtNetwork.QNetworkReply.error > > -- > Hugo Parente Lima > INdT - Instituto Nokia de Tecnologia > Thanks for your reply Hugo! -- Luca Donaggio
_______________________________________________ PySide mailing list [email protected] http://lists.openbossa.org/listinfo/pyside
