I have both qt4 and qt5 on my Linux system. qt4 is used by default. What is a clean way to change that so that qmake uses qmake-qt5 by default?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The system might have different meta packages that handle the default.
For example on Debian there is a qt4-default
and a qt5-default
package, installing one of them will uninstall the other and set the symlinks appropriately
回答2:
There is a tool named qtchooser to switch between Qt versions. On Debian and Ubuntu you can install it with apt-get install qtchooser
.
Easiest way is to use it to list the alternatives and then create QT_SELECT
environment variable.
$ qtchooser -list-versions
4
5
default
opt-qt55
qt4-i386-linux-gnu
qt4
qt5-i386-linux-gnu
qt5
Then you create QT_SELECT
environment variable and set e.g. export QT_SELECT=4
or export QT_SELECT=5
.