[Qt-interest] QDataStream backwards incompatibility introduced in 4.6

Thiago Macieira thiago at kde.org
Thu Jan 21 19:24:48 CET 2010


Em Quinta-feira 21 Janeiro 2010, às 16:24:01, André Fillipe escreveu:
> 2010/1/21 Lene Preuss <lene.preuss at googlemail.com>
> 
> > Hi list,
> > 
> > [...]
> > 
> > The output on my system is:
> > 0.0078125
> > 0
> > 0
> > not, as you might expect,
> > 1.0
> > 0.429043
> > 1.2
> 
> Why would this be expected behavior? The writeFile and readFile functions
> use different stream versions. Floats written by Qt 4.5 are correctly read
> by Qt 4.6 if the stream version is set appropriately. Am I missing
> something?

No.

QDataStream versions do not retain any binary compatibility. You have to use 
the same version for reading and for writing.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100121/4a69edae/attachment.bin 


More information about the Qt-interest-old mailing list