Python Desktop Handbook

Version 1.0-draft

Python Desktop Handbook

Building Desktop Applications with GTK 4 and Qt 6

Start reading Download PDF

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.

  1. Changelog

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. 1 Getting Started with GTK 4
  2. 2 GObject: Properties, Signals and Bindings
  3. 3 More GTK 4
  4. 4 Threads and Asynchronous Work
  5. 5 Drawing with Cairo
  6. 6 Custom Widgets
  7. 7 Printing
  8. 8 Desktop Integration
  9. 9 Audio and Video with GStreamer
  10. 10 D-Bus
  11. 11 Animation and Transitions
  12. 12 Embedding Web Content
  13. 13 Internationalization
  14. 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.

Back matterAppendices & references

  1. A Book Text Licenses
  2. B Source Code License
  3. C Migrating from PyGTK
  4. D Icon Names
  5. Further Reading