[Qt-interest] Qfile.readAll() returning signed quint64-qbytearray

Joakim Saxin joakim at thoreb.se
Mon Nov 1 11:57:56 CET 2010


Sorry for the weird topic but I am confused. 

Basically, file.readAll() returns a QByteArray. Now, if a byte in file is has MSB set, QFile seems to interpret this as as signed value, and so uses two-complement conversion to the 64-bit that I have most bitterly learned is what QByteArray actually stores. 

Because of this, certain values held byte QByteArray, a datastructure you would figure indexes single bytes, are in the neighbourhood 1.84467440737e19 unless treated as signed. 

I am tempted to report this as a bug but must suspect there is something I am doing wrong (and have been for quite a while). Does anyone know?

Best regards and happy 0x101101 day all. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101101/22956d02/attachment.html 


More information about the Qt-interest-old mailing list