[SOLVED] How to use "Qt compatibility layer" mode while compiling and building applications build from QT4 in QT5 using "compatibility members"
-
I have QT creator 2.6.1 installed. I have configured 'kit' both for QT 4.8.2 and QT 5.0.0. I am able to build both QT4 and QT5 projects from QT Creator 2.6.1. I am able to build an old project of 4.8.2 in QT 5 successfully.
I have a project, already built in QT 4.8.2 and running. I have created a copy of the project in different folder. I am trying to build the copied project in QT 5. The current project is using some of the methods which are marked as "compatibility members" in QT 5 classes. As this project is older project. Will it be possible for me to build this project where "compatibility members" are used?
If 'Yes", what settings I have to do in my project (.pro) file or my CPP or H files to ON "Qt compatibility layer" while building?
Regards
-
If you are talking about Qt3 compatibility: it has been removed in Qt5.
If you are talking about Qt4 compatibility: use QT_DISABLE_DEPRECATED_BEFORE to define the acceptable API version.
-
Thank you Lukas for the help.
As mentioned above, QT3 compatible members will not be working in QT5.
We should try to modify the usage of deprecated members as much as possible. If in case there is no choice left then only we can use the define in project (.pro) file (first statement possible) as
@DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x000000@