LinuxCommandLibrary

qt-select

TLDR

Show current Qt version

$ qtchooser -print-env
copy
List available versions
$ qtchooser -l
copy
Select Qt version
$ export QT_SELECT=[qt5]
copy
Run tool with specific Qt
$ qtchooser -run-tool=[qmake] -qt=[5]
copy

SYNOPSIS

qtchooser [options]

DESCRIPTION

qtchooser (or qt-select) allows switching between multiple Qt installations. It manages which Qt version's tools (qmake, moc, etc.) are used by default.

PARAMETERS

-l, --list-versions

List available Qt versions.
-print-env
Print environment settings.
-run-tool=tool
Run specific tool.
-qt=version
Select Qt version.

EXAMPLES

$ # List available
qtchooser -l

# Show current
qtchooser -print-env

# Use Qt 5
export QT_SELECT=qt5
qmake --version

# Use Qt 6
export QT_SELECT=qt6
qmake --version

# Run specific qmake
qtchooser -run-tool=qmake -qt=5 --version
copy

CONFIGURATION

$ # System configs
/usr/share/qtchooser/

# User config
~/.config/qtchooser/

# Config file format (qt5.conf):
/usr/lib/qt5/bin
/usr/lib/qt5/lib
copy

ENVIRONMENT

$ QT_SELECT=qt5     # Default version
QTCHOOSER_NO_GLOBAL_DIR=1  # Ignore system configs
copy

CAVEATS

Not available on all distributions. May conflict with manually installed Qt. Use environment variable for persistent selection.

HISTORY

qtchooser was created to manage multiple Qt installations on Linux systems with distribution packaging.

SEE ALSO

Copied to clipboard