Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
What's the difference between forwards and backwards compatibility? Anything to worry about going from 5.8 to 5.9.1?
I've been considering upgrading from Qt 5.8 to 5.9.1 and read here about compatibility issues. I googled forwards compatibility but couldn't find a very simple explanation. What's the difference between forwards and backwards compatibility? Maybe an example would help... Also source compatibility ensures making an upgrade from 5.8 to 5.9.1 requires nothing more than recompiling with the new version right? No need to change any code at all correct? Lastly I need to change my setVersion when using QDataStream to write binary data to take advantage of any new functionality right?
AlexMal last edited by AlexMal
Assume you wrote a text editor which stores the document in the file.
forward compatibility would allow OLD versions of editor to read and process files generated by LATER versions of editors.
backward compatibility would allow the exact or LATER versions of editor to read and process files generated by EARLIER versions of editors.
The same applies to QDataStream.
in case of backward compatibility
if you wrote files using QDataStream. in Qt 5.8
you would be able to read then in qt 5.9.1, but opposite will not be true.
If it is/was forward compatible, it would not matter which version was used when file was written, any version would be able to read it.
AlexMal last edited by
This post is deleted!
Backward compatibility means: provided that you are not using a function that has been added to 5.9, you can replace the complete set of Qt libraries and plugins you provide with your application by an older version without recompiling it.
Forward compatibility means: you can replace the complete set of Qt libraries and plugins with a newer version without recompiling it.
There's no need to change the version you use of QDataStream unless you see a need for it.
Thanks guys. If I change from Qt 5.8 to 5.9.1 I don't need to change any of my code; the old code will run flawlessly with the new version right?
One thing to take into account if you are using QDataStream is to set it to the lowest version of Qt you want to support. The format can change between two releases so files might not be readable unless you fix that version.
Crag_Hack last edited by Crag_Hack
No need to change any code upgrading from 5.8 to 5.9.1 right? No reason anything would break?
Yes - there is no reason for anything to break.
it is not a big jump in version
so with a little luck. All will just work.
But since you can both 5.8 and 5.9.1 installed,
just try it and see :)
I'm thinkin' I'm fine as per here under source compatibility. Just wanted to make sure.