QDataStream format change in Qt3.1

Lubos Lunak l.lunak at suse.cz
Thu Sep 12 13:01:53 BST 2002


 QDataStream default version in Qt3.1 changed from 4 to 5, making the two 
formats incompatible(*). QDataStream is used for marshalling data at least in 
ksycoca and DCOP, which AFAIK are supposed to stay backwards compatible.

 The ksycoca file is supposed to be used even by KDE2 apps (I wonder if they 
actually really work in KDE3, even though the QDataStream change Qt2.x->Qt3.0 
doesn't seem to affect any types used in ksycoca - if they don't work, maybe 
we should try harder for KDE4 ). Making sure the format of ksycoca stays the 
same is simple, just explicitly using QDataStream::setVersion() in all 
ksycoca-related code.

 DCOP is worse, stubs suck, and the recent DCOPRef idea came too late - most 
code uses QDataStream directly, so there's no way how to call 
QDataStream::setVersion() there. If QDataStream would at least write the 
version before writing the very first element into the stream, that could 
handle the problem, but QDataStream doesn't do so. Any better idea than 
asking TT to make static QDataStream::setDefaultVersion() ? Or shouldn't we 
just care?
 Does somebody know any other place where changes in QDataStream format could 
break things?

 (*) Actually the only change between versions 4 and 5 seems to be QImage, so 
for practical purposes it probably can be considered compatible, but still, 
the problem of future versions remains.

Lubos Lunak
KDE developer
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/

More information about the kde-core-devel mailing list