a question regarding Qt version



  • if i wrote a code with Qt 5.3 will it compie with Qt 5.2?


  • Qt Champions 2016

    @Batman
    Hi and welcome
    Most of the time yes.
    From version to version sometimes codes are changed so one need to fix something.
    But such cases are often when jumping more than one version. like from 4.8 to 5.5

    From 5.3 to 5.2 should just work unless you find and use a feature first introduced in 5.3


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Unless you are using a feature introduced in 5.3, you can compile your code with an older version of the same major series (like your example 5.3 -> 5.2 but it goes back to 5.0) without any problem.

    Qt guaranties backward compatibility both source and binary for a major release lifetime, but again that stands if you don't use a feature introduced in a more recent version.



  • You may have problems with loading translation files qt_xx.qm. They were split since 5.3.
    Also prefer to use "old" way of connecting signals and slots: SIGNAL/SLOT macros over newest one with method references.


  • Lifetime Qt Champion

    @SeeLook can you explain why the old syntax should be preferred ?



  • I built my app for different Linux distributions. Whenever the build was against Qt 5.2, it failed on connect statements of some classes of mine (derived from QObject). So simple solution was to keep old format.
    I can't explain what was actually a source of this issue.


  • Moderators

    @SeeLook said:

    I built my app for different Linux distributions. Whenever the build was against Qt 5.2, it failed on connect statements of some classes of mine (derived from QObject). So simple solution was to keep old format.
    I can't explain what was actually a source of this issue.

    Then I recommend you try to find out the source of this issue. It's not nice to tell others to use the old way without understanding why.



  • Meanwhile I did....
    The reason was that on those platforms compiler flag to use c++11 was not set by default. So my code was not able to use this new format without that.
    Forgive me didn't realise that before.


  • Moderators

    @SeeLook said:

    The reason was that on those platforms compiler flag to use c++11 was not set by default. So my code was not able to use this new format without that.

    I'm glad you found it!

    Forgive me didn't realise that before.

    No problem :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.