Lesson 02 · Desktop Apps with Python & Qt
Desktop: Signals, Slots & Events
Make your interface react: connect signals to slots, receive the data signals carry, emit custom signals, override event handlers sparingly, and ask questions with modal dialogs - in a live unit converter.
Prerequisites: Desktop: Windows, Widgets & Layouts with PySide6
Learning objectives
By the end of this lesson, you will be able to:
- Connect signals to slots so user actions run your code
- Write slots that receive the data a signal carries
- Define and emit custom signals with Signal
- Choose between event-handler overrides and shortcuts for keyboard input
- Ask the user questions with modal QMessageBox dialogs and act on the answer