1

Yes the title is correct...we are going BACK to qt4. We recently built a decent size app with Qt5. We now been told that the app must support RH 6 and RH 5 distros.

Since RH6 ships with Qt 4.6.2 and Rh 5 ships with Qt 3.3.6, I'm concerned about having to make lots of modifications to port back to older versions of Qt.

Can the latest versionf of Qt 4.x and 3.x understand new syntax of Qt5 (eg: connect is slightly different)? If not, can someone suggest how best to undertake this? Are we looking at ifdef'ing our way out of this? (and if so, is there an easy reference for how to do this)

Christophe
  • 68,716
  • 7
  • 72
  • 138
TSG
  • 4,242
  • 9
  • 61
  • 121
  • 1
    to be honest, in a small project this can be done in a few moments, but it scales badly. you have to use other libraries/includepath to handle where the code comes from ... qt5 changed the packages a lot as well as the changed functions ... like `QString::toAscii()` is not presented in Qt5 anymore (for example). and afaik, between Qt3 and Qt4 was also some major changes, so maybe classes you are using in Qt5 wasnt present in Qt3 and backwards ... – Zaiborg Oct 15 '13 at 13:53
  • I'm relieved that its not too big. Is there a list somewhere of differences? As well, is there a Qt standard for checking for Qt version number for condition compilation? – TSG Oct 15 '13 at 18:33
  • 1
    qt defines `QT_VERSION_STR` to determine what version there is ... and i think it is `QT_VERSION` that is an integer value. but how to change the used function call ... THIS is actually the dirty work :) – Zaiborg Oct 15 '13 at 20:17
  • Quick hint: Qt5 understands well Qt4 connect syntax, so it's one less thing to "ifdef" – Kamil Klimek Oct 25 '13 at 07:42
  • Michelle, it is hard to say (i.e. take it as too broad), but you will most likely have big problems with Qt 3. I would suggest to make the management reconsider this RH 5 and 6 idea, or your customers. I would suggest NOT do the other way around. – László Papp Dec 19 '13 at 07:58

1 Answers1

3

Consider building qt5 libraries and deploying them (only ones you actually use) together with your project. This link can help to build.

I actually built them today on my CentOS 6.5 64-bit with this configuration command:

./configure -prefix /opt/my_prod/Qt-5.2.1 -release -nomake examples -dbus -qt-xcb -no-c++11

However I did not built all libs listed on the link and did not apply patches.

Then I built a small test app and ran it on CentOS and then on Ubuntu 12.04 (to which Qt5 libs I copied manually).

kopalvich
  • 434
  • 5
  • 14