Lesson 06 · Desktop Apps with Python & Qt
Desktop Capstone: Build & Package a Real App
The capstone: build QuickNote for real - an architecture of three parts, a notes list beside an editor, JSON persistence, QSettings window memory and a PyInstaller build - then test what can be tested, walk a manual checklist for the rest, and release-test the artifact on a clean machine.
Prerequisites: Desktop: Packaging & Distribution
Learning objectives
By the end of this lesson, you will be able to:
- Design a small desktop app as three parts with one job each - a Note data class for the data, a Qt-free NoteStore that owns JSON persistence, and a MainWindow that owns the widgets and wires them to the store - and explain why that split makes each part independently testable
- Build the QuickNote interface end to end: a notes list beside an editor pane with create, rename and delete actions, selection that loads the right note, and live edits that never land in the wrong note
- Persist two kinds of state honestly: the user's notes as JSON in a sane file location with a defensive load that treats corrupt files as a fresh start, and window geometry through QSettings under a named application and organization
- Verify a GUI app the honest way: headless tests for the pure store, plus a written manual checklist with pass/fail lines for everything that needs eyes
- Package the finished app with PyInstaller --onefile --windowed from a clean virtual environment and release-test the artifact on a machine with none of your tools, recording the operating system gate's wording verbatim