How to change the default Qt version?

Gregory Smitherman picture Gregory Smitherman · Dec 25, 2017 · Viewed 10.2k times · Source

I am trying to build a program and need Qt 5.10.

When I run qmake -v I get:

QMake version 3.0
Using Qt version 5.6.2 in /home/greg/anaconda2/lib

When I run qtchooser -list-versions I get:

4
5
default
qt4-x86_64-linux-gnu
qt4
qt5-x86_64-linux-gnu
qt5

When I open Qt Creator and go to Tool>Options>Build & Run>Qt Versions, I have the following:

screenshot

I saw the following issue and tried some of the answers but with problems like missing dependencies. When I try to install the dependencies, the dependencies require dependencies that break the install so they cannot be installed.

https://unix.stackexchange.com/questions/116254/how-do-i-change-which-version-of-qt-is-used-for-qmake

When I run qmake -query I get:

QT_SYSROOT:
QT_INSTALL_PREFIX:/home/greg/anaconda2
QT_INSTALL_ARCHDATA:/home/greg/anaconda2
QT_INSTALL_DATA:/home/greg/anaconda2
QT_INSTALL_DOCS:/home/greg/anaconda2/doc
QT_INSTALL_HEADERS:/home/greg/anaconda2/include/qt
QT_INSTALL_LIBS:/home/greg/anaconda2/lib
QT_INSTALL_LIBEXECS:/home/greg/anaconda2/libexec
QT_INSTALL_BINS:/home/greg/anaconda2/bin
QT_INSTALL_TESTS:/home/greg/anaconda2/tests
QT_INSTALL_PLUGINS:/home/greg/anaconda2/plugins
QT_INSTALL_IMPORTS:/home/greg/anaconda2/imports
QT_INSTALL_QML:/home/greg/anaconda2/qml
QT_INSTALL_TRANSLATIONS:/home/greg/anaconda2/translations
QT_INSTALL_CONFIGURATION:/home/greg/anaconda2
QT_INSTALL_EXAMPLES:/home/greg/anaconda2/examples
QT_INSTALL_DEMOS:/home/greg/anaconda2/examples
QT_HOST_PREFIX:/home/greg/anaconda2
QT_HOST_DATA:/home/greg/anaconda2
QT_HOST_BINS:/home/greg/anaconda2/bin
QT_HOST_LIBS:/home/greg/anaconda2/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.0
QT_VERSION:5.6.2

How can I change the paths to /usr/lib/qt5/*?

Answer

Luca Carlon picture Luca Carlon · Dec 25, 2017

I'm not sure what issue you're talking about, but the command you issued returns the version in the path, which is not 5.10 as you can see. You may need to create a kit with the Qt version you created. Then, set the kit in the "Projects" tab.

Refer to this for complete instructions.