For all of those who didn't uninstal old version and are wondering how to change the qt directory location.
The correct way is to export the QT_SELECT variable and add the custom ~/.config/qtchooser/somename.conf file.
This will be a qt installation visible in qtchooser -l under "somename".
QT_SELECT=somename; qtchooser -print-env
Will return your custom location.
The downside of changing the default.conf is that it might invalidate where your old qt version is found, when I did change it to /some/path, after executing:
QT_SELECT=qt4; qtchooser -print-env
It find the newer version on my path, however with the ~/config/qtchooser/somename.conf the earlier version is intact.
It is mentioned at the end of the
man qtchooser help:
System-wide configuration files. Each has two lines, the first is the path to the binaries and the second is the path to the Qt
libraries. If a default.conf is provided, the settings
from it will be automatically used in case nothing else is selected.