We recently began using Qt 5 with Qt Creator 2.7, on a CentOS 6.4 system. As you may know, CentOS requires Qt 4.6, so I can’t remove it and I’m stuck with 2 Qt installations side by side.
I properly configured the Qt Version and the Desktop kit in the Qt Creator Build & Run options. I have also configured a set of environment variables in the .bashrc file as follows:
#Qt-5.0.1 exports
export QTDIR="/workspace/third_party/libs/qt-5.0.1"
export PATH="${QTDIR}/bin:${PATH}"
export LD_LIBRARY_PATH="${QTDIR}/lib"
export CMAKE_PREFIX_PATH="${QTDIR}"
export PKG_CONFIG_PATH="${QTDIR}/lib/pkgconfig"
Builds complete successfully and run fine. Nonetheless, when coding, it seems that Qt Creator stills look in the /usr/include folder for header files when Shift+clicking Qt classes, and wrong entries appear in the code completion. I’m out of clues as to what I have done wrong and I am looking for any suggestions that could help me sort this out.
– EDIT –
The problem seems to occur only with Cmake projects.
I’m not sure yet if this should be reported as a bug. It seems that working with projects using different Qt versions confuses the editor. Once a Qt4 project has been opened, the editor gets confused and finds files randomly in either the project’s current kit include dir or the default include path (/usr/include on my system). However, the changes seem permanent!!! As if the session or the cmake projects manager stores some cache about the environment. Restarting Qt Creator and opening only a Qt5 project is not enough.
↧