Version 1.0-draft
Python Desktop Handbook
Building Desktop Applications with GTK 4 and Qt 6
This book is a working notebook for writing desktop applications in Python. It covers two toolkits in parallel — GTK 4 with PyGObject, and Qt 6 with PySide6 — and the technologies around them: drawing, printing, multimedia, D-Bus, embedded web content, translation and packaging.
Every listing is a real file under examples/, and every example is started on
each build, so the code in these pages is code that runs.
It began as one person’s notes on PyGTK and GTK 2. That edition is still in the git history; this one is being rewritten from it, chapter by chapter.
Part 1GTK 4 with PyGObject
GTK 4 and libadwaita are the native toolkit of the GNOME desktop. This part builds an application from a first window up to a packaged Flatpak.
- 1 Getting Started with GTK 4
- 2 GObject: Properties, Signals and Bindings
- 3 More GTK 4
- 4 Threads and Asynchronous Work
- 5 Drawing with Cairo
- 6 Custom Widgets
- 7 Printing
- 8 Desktop Integration
- 9 Audio and Video with GStreamer
- 10 D-Bus
- 11 Animation and Transitions
- 12 Embedding Web Content
- 13 Internationalization
- 14 Packaging and Distribution
Part 2Qt 6 with PySide6
PySide6 is Qt's own Python binding. This part covers the same ground again, so you can pick a toolkit knowing what each one asks of you.