qtchooser

Switch between multiple Qt installations

TLDR

List available Qt versions
$ qtchooser --list-versions
Print environment info
$ qtchooser --print-env
Run tool with specific Qt version
$ qtchooser --run-tool=[qmake] --qt=[5]
Install Qt version entry
$ qtchooser --install [version_name] [path/to/qmake]
Display help
$ qtchooser --help

SYNOPSIS

qtchooser [--list-versions] [--print-env] [--run-tool tool --qt version] [--install name path]

DESCRIPTION

qtchooser manages multiple Qt installations on a system. It allows developers to switch between different Qt versions (Qt4, Qt5, Qt6) for building applications.The tool wraps Qt development binaries (qmake, moc, uic, etc.) and directs them to the selected Qt installation based on configuration files or command-line options.

PARAMETERS

--list-versions

List available Qt versions
--print-env
Print Qt environment variables
--run-tool _tool_
Run specified Qt tool
--qt _version_
Select Qt version to use
--install _name_ _path_
Register a Qt installation
-qt=version
Short form of --qt, accepted directly on wrapper binaries (e.g. `qmake -qt=5`).
-run-tool=tool
Short form of --run-tool.
-list-versions, -print-env
Single-dash aliases of the corresponding long options.

CONFIGURATION

/usr/share/qtchooser/

System-wide Qt version configuration files, each specifying bin and lib paths for a Qt installation.
~/.config/qtchooser/
User-level Qt version configuration files overriding system defaults.
QT_SELECT
Environment variable selecting the default Qt version (e.g., qt5, qt6).

INSTALL

sudo apt install qtchooser
sudo dnf install qtchooser

CAVEATS

Not all distributions use qtchooser; Debian/Ubuntu still do, but Fedora and Arch dropped the wrapper in favor of qualified binary names (`qmake-qt5`, `qmake6`). Qt 6 installations frequently do not register themselves — you may need to --install them manually.

HISTORY

qtchooser was created to handle the transition between Qt4 and Qt5 on Linux systems, allowing both versions to coexist while maintaining compatibility with build systems.

SEE ALSO

qmake(1), moc(1), qt-select(1)