2

Event Handling – Signals and Slots

The signals and slots mechanism in Qt 6 is one of its most important features. It’s a method that allows communication between objects, which is a crucial part of a program’s graphical user interface. A signal can be emitted from any QObject object or its subclasses, which will then trigger any slot functions of any objects that are connected to the signal.

In this chapter, we’re going to cover the following main topics:

  • Signals and slots in a nutshell
  • UI events with signals and slots
  • Asynchronous programming made easier
  • Function callbacks

Technical requirements

The technical requirements for this chapter include Qt 6.6.1 MinGW 64-bit and Qt Creator 12.0.2. All the code used in this chapter can be downloaded ...

Get Qt 6 C++ GUI Programming Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.