Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. What's the difference between forwards and backwards compatibility? Anything to worry about going from 5.8 to 5.9.1?
Forum Updated to NodeBB v4.3 + New Features

What's the difference between forwards and backwards compatibility? Anything to worry about going from 5.8 to 5.9.1?

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 4 Posters 3.0k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Crag_Hack
    wrote on last edited by
    #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?

    A 1 Reply Last reply
    0
    • A Offline
      A Offline
      AlexMal
      wrote on last edited by AlexMal
      #2

      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.

      @Crag_Hack said in What's the difference between forwards and backwards compatibility? Anything to worry about going from 5.8 to 5.9.1?:

      QDataStream
      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.

      1 Reply Last reply
      0
      • C Crag_Hack

        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?

        A Offline
        A Offline
        AlexMal
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          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.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Crag_Hack
            wrote on last edited by
            #5

            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?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • C Offline
                C Offline
                Crag_Hack
                wrote on last edited by Crag_Hack
                #7

                No need to change any code upgrading from 5.8 to 5.9.1 right? No reason anything would break?

                mrjjM 1 Reply Last reply
                0
                • C Crag_Hack

                  No need to change any code upgrading from 5.8 to 5.9.1 right? No reason anything would break?

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Crag_Hack
                  Hi
                  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 :)

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    Crag_Hack
                    wrote on last edited by
                    #9

                    I'm thinkin' I'm fine as per here under source compatibility. Just wanted to make sure.

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved