Linux/Unix (Qt)¶
The Toga backend for Linux (and other Unix-like operating systems) running KDE is toga-qt.
toga-qt requires Python 3.10+, and Qt 6.8 or newer.
Experimental Backend
While the GTK 3 backend is mostly completed in functionality, the Qt backend is currently a pre-alpha prototype.
Qt on Windows and macOS
Although Qt can be installed on Windows and macOS, and the toga-qt backend may work on those platforms, this is not officially supported by Toga. We recommend using toga-winforms on Windows, and toga-cocoa on macOS.
Prerequisites¶
Most Qt testing occurs with Qt 6.10 as this is the version that is installable through pip.
The system packages that provide Qt must be installed manually:
These instructions are different on almost every version of Linux and Unix, in addition to whether Wayland or X11 is used; here are some of the common alternatives:
Ubuntu 24.04 / Debian 11+¶
(venv) $ sudo apt install git python3-dev build-essential \
libwayland-dev libwayland-egl1-mesa libwayland-server0 \
libgles2-mesa-dev libxkbcommon-dev gnome-session-canberra
(venv) $ sudo apt install git python3-dev build-essential \
libfontconfig1-dev libfreetype-dev libgtk-3-dev \
libx11-dev libx11-xcb-dev libxext-dev \
libxfixes-dev libxi-dev libxkbcommon-dev \
libxkbcommon-x11-dev libxrender-dev 'libxcb*-dev' \
gnome-session-canberra
Fedora 41+¶
Requirement to Update System Packages
Fedora's packaging of some Qt and KDE-related packages lists incorrect dependency versions; installing certain packages that updates KWin or related things may brick your system. Therefore, it is highly recommended, as a general precaution, to upgrade all packages following the installation of these components.
(venv) $ sudo dnf install git python3-devel \
libcanberra-gtk3 wayland-devel libwayland-server \
mesa-libEGL libxkbcommon-devel
(venv) $ sudo dnf upgrade --refresh
(venv) $ sudo dnf install git python3-devel \
libcanberra-gtk3 fontconfig-devel freetype-devel \
gtk3-devel libX11-devel libX11-xcb libXext-devel \
libXfixes-devel libXi-devel libxkbcommon-devel \
libxkbcommon-x11-devel libXrender-devel 'xcb-util*devel' \
(venv) $ sudo dnf upgrade --refresh
If you're not using one of these, you'll need to work out how to install the developer libraries for python3, Qt's X11 dependencies, Qt's Wayland dependencies, and the executable canberra-gtk-play (and please let us know so we can improve this documentation!)
Installation¶
toga-qt must be installed directly using pip. The pyside6 optional extra is used to request the installation of the Python language bindings for Qt.
$ python -m pip install toga-qt[pyside6]
Implementation Details¶
The toga-qt backend uses Qt 6.
The native APIs are accessed using the PySide6 bindings.