LinuxCommandLibrary

qt-select

Switch between Qt installation versions

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

/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).
QTCHOOSER_NO_GLOBAL_DIR
Environment variable to ignore system-wide configuration directory when set to 1.

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

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community