[Qt-interest] QDataStream backwards incompatibility introduced in 4.6

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Fri Jan 22 15:37:35 CET 2010


Lene Preuss wrote on Friday, January 22, 2010 2:56 PM:

> > ...
> The upshot of this is, upgrading Qt to 4.6 may break existing
> programs. If you wish, you can consider these programs as sloppily
> written - but in any case, it should be noted that breakage may
> occur.   

Valid point. Lesson learned: never rely on implicit settings - always say stuff explicitly!

So if you /know/ that you are reading data from a previous application version, convert your data before reading and explicitly set the Qt version, telling your reader "This datastream comes from a previous Qt version".

However, if you deploy your application on e.g. Linux and rely on the distribution Qt version, and some superuser decides to upgrade the Qt from e.g. 4.5 to 4.6 on their own, the your app is in trouble - but even in this case setting explicitly the Qt version to the data stream should not harm and should prevent unexpected behaviour, as you mentioned previously.

Cheers, Oliver

-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list