Preface

Why this book exists

The book started as a (now defunct) blog. The goal is to collect ready-made, stripped-down techniques for Qt programming that I often find myself researching online and recreating from scratch.

Who it is for

The intended audience is beginner-to-intermediate Qt Widgets developers. The book focuses on individual Qt features and programming techniques rather than advanced application development. Topics such as application architecture, profiling, performance optimization, and other advanced aspects of Qt development are outside of its scope.

Although it covers some general Qt topics like the Qt object model, model-view programming, multithreading, and special topics, the book does not have any Qt Quick/QML-specific material.

How the book works

The book is made up of six parts:

  • Foundations. Installation and basic PySide6 application mechanics that lets you work through the rest of the book comfortably.

  • The Qt Widgets Toolkit. Contains frequently used Qt widgets examples, organized by data type each receives as input.

  • The Qt object model. Qt object trees, signals & slots, event, timers, and properties.

  • Model-View Programming. List, table, and item models, delegates, sorting, filtering, and selection.

  • Multithreading. Qt multithreading facilities.

  • Special Topics. Databases, processes, the Graphics View Framework, and the Animation Framework.

Several common Qt topics are not covered, notably the resource system, drag and drop, clipboard, undo and redo, networking, system tray integration, and packaging.

Most sections follow this format:

  • A brief introduction of the topic, with API details and class diagrams where needed.

  • The section task explained. Most tasks are framed to somewhat resemble real-world scenarios you would encounter when writing a financial application.

  • The code followed by a numbered walkthrough explaining how it works.

  • Notes with illustrations, and gotchas you may encounter.

There are a few chapters, like 14. and 32., that deliberately depart from this format.

Each section aims to be a short and to-the-point showcase of a single Qt topic, without referencing Qt features not yet covered earlier in the book. This is not always possible.

Versions

Code examples are tested on Windows and Linux with PySide6 6.9.1. Some are also tested with PySide6 6.11.1.

The companion repo

The code is available on Github:

https://github.com/JoeAnonimist/pyside6-blueprints-code

You can contact me through the above repo issues.

AI assistance

AI tools were used for research, debugging, proofreading, table formatting, and exploring alternative approaches to examples. Almost all diagrams included in the book were generated with AI help as SVG files. AI-generated output was not treated as authoritative, particularly where Qt behavior or API details were concerned.