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

List:       pykde
Subject:    Re: [PyKDE] QIODevice.readBlock must return a tuple
From:       Yann Cointepas <yann () sapetnioc ! org>
Date:       2005-05-19 18:18:08
Message-ID: 200505192018.08415.yann () sapetnioc ! org
[Download RAW message or body]

But, it fails if I return a tuple containing the size and the string (a 
message indicating a wrong return type is shown). It only work if a tuple 
containing a single string is returned. If I understand sip (I first looked 
to the *.sip yesterday) I would say it is due to this line in 
%VirtualCatcherCode of readBlock in qiodevice.sip :

sipParseResult(&sipIsErr,sipMethod,result,"(O)",&buf);

My Qt version is > 3.0.0 but the same line is used twice so I think it is the 
same for all versions.


Le jeudi 19 Mai 2005 17:52, vous avez écrit :
> > When subclassing QIODevice, I noticed (with a look at qiodevice.sip) that
> > readBlock method must return a tuple with a string. I would expect this
> > method to return a string. But my knowledge of sip/PyQt is not enough to
> > say
> > if it is a bug or not.
>
> It's not a bug - it returns a tuple of the length of the data and the data
> itself. I agree it could be made more Pythonic - just return the data as
> you suggest (maybe PyQt4).
>
> Phil

-- 
Yann Cointepas                         Tel: +33 1 69 86 78 52
CEA - SHFJ                             Fax: +33 1 69 86 77 86
4, place du Général Leclerc
91401 Orsay Cedex France

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

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

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