Kick off your book project in 3 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Saturday, May 16, 2026. Learn more…

Leanpub Header

Skip to main content

Learning PySide6

A Practical Guide to Building GUI Applications with Python and Qt6

Working with PySide6 should not depend on trial and error. This book replaces fragmented learning with a structured approach, combining in-depth explanations and dependable code examples that move you forward with confidence.

Minimum price

$25.00

$35.00

You pay

$35.00

Author earns

$28.00
$
You can also buy this book with 1 book credit. Get book credits with a Reader Membership or an Organization Membership for your team.
PDF
EPUB
688
Pages
About

About

About the Book

A graphical user interface is often the first—and most critical—layer of interaction between software and its users. Building it correctly requires more than assembling widgets; it requires understanding how components communicate, how layouts adapt, and how applications remain responsive under real-world conditions.

Learning PySide6: A Practical Guide to Building GUI Applications with Python and Qt6 (Volume 1: Essential Foundations) focuses on the knowledge that matters. You will begin with signals and slots—the core mechanism behind every Qt application—and progress through layout management, widget systems, and the Model-View architecture. Along the way, you will explore styling with Qt Style Sheets, multithreading, and practical data handling using JSON, XML, and SQLite.

Each chapter is designed with clarity and purpose. Concepts are introduced in context, supported by complete, runnable examples that reflect real development scenarios—not isolated fragments.

By the end of this volume, you will be able to build desktop applications that are responsive, maintainable, and ready for production use. More advanced topics and large-scale case studies will be explored in the next volume, providing a natural continuation for those who want to go further.

This book is intended for Python developers who want to move beyond basic interfaces and build GUI applications with structure, confidence, and precision.

Share this book

Author

About the Author

Budi Raharjo

Two decades of expertise in software engineering and technical training.

Contents

Table of Contents

Preface

  1. PART I: PYTHON GUI AND PYSIDE6 FUNDAMENTALS

Chapter 1. Introduction to Modern GUI Development

  1. 1.1 Why PySide 6? (History, LGPL License, Advantages vs PyQt/Tkinter)
  2. 1.2 Qt Architecture and Integration with Python
  3. 1.3 Development Environment Setup (Virtual Environment, PIP, IDE Setup)
  4. 1.4 First “Hello World” with PySide6

Chapter 2. PySide6 Fundamentals

  1. 2.1 PySide6 Application Structure: QApplication, Event Loop, and Widget
  2. 2.2 Signals and Slots: Qt’s Communication Paradigm
  3. 2.3 Object Model and Memory Management in PySide6
  4. 2.4 Working with Properties and Dynamic Properties

Chapter 3. Layout Management

  1. 3.1 Absolute Positioning vs Layout Managers
  2. 3.2 Box Layout (QVBoxLayout, QHBoxLayout)
  3. 3.3 Grid Layout and Form Layout
  4. 3.4 Nested Layouts for Complex UI
  5. 3.5 Stretch, Spacers, and Alignment
  6. PART II: CORE WIDGETS AND CONTROLS

Chapter 4. Basic Widgets

  1. 4.1 Text Widgets: QLabel, QLineEdit, QTextEdit
  2. 4.2 Button Widgets: QPushButton, QRadioButton, QCheckBox
  3. 4.3 Numerical Inputs: QSpinBox, QSlider, QDial
  4. 4.4 Selectors: QComboBox, QListWidget, QTreeWidget

Chapter 5. Container and Advanced Widgets

  1. 5.1 Tab Widgets and Toolboxes
  2. 5.2 GroupBox, ScrollArea, and Frame
  3. 5.3 Dialog Boxes: QMessageBox, QInputDialog, QFileDialog
  4. 5.4 Main Window Components: MenuBar, ToolBar, StatusBar

Chapter 6. Model-View Programming

  1. 6.1 Model-View-Delegate Concept
  2. 6.2 QListView, QTableView, QTreeView
  3. 6.3 Custom Models with QAbstractItemModel
  4. 6.4 Custom Delegates for Rendering and Editing
  5. PART III: MODERN UI DESIGN AND UX

Chapter 7. Styling with Qt Style Sheets (QSS)

  1. 7.1 QSS Syntax: Selectors, Properties, Pseudo-states
  2. 7.2 Customizing Widget Appearance
  3. 7.3 Theme and Palette Management
  4. 7.4 Best Practices for a Consistent UI

Chapter 8. Graphics and Custom Painting

  1. 8.1 QPainter and Coordinate System
  2. 8.2 Drawing Shapes, Text, and Images
  3. 8.3 Custom Widget with paintEvent() Override
  4. PART IV: PRODUCTION APPLICATION FEATURES

Chapter 9. Multithreading and Asynchronous Operations

  1. 9.1 Worker Thread with QThread
  2. 9.2 Cross-Thread Signal/Slot Communication
  3. 9.3 Thread Pools and Best Practices
  4. 9.4 Avoiding GUI Freeze

Chapter 10. Data Handling and Persistence

  1. 10.1 Working with JSON, XML, and SQLite
  2. 10.2 Model-View with Database Backend
  3. 10.3 Drag and Drop Operations
  4. 10.4 Clipboard Integration

Chapter 11. Internationalization and Accessibility

  1. 11.1 Multi-language Support (tr(), .ts files, lupdate)
  2. 11.2 Right-to-Left Language Support
  3. 11.3 Accessibility Features (Screen Reader Support)

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub