In Chapter 2, Writing Your First Qt Application, I provided a very brief introduction to slots and signals, and talked about how clicking on the Enter Name button is communicated to MainWindow. That should have been just enough to whet your appetite to know more.
Signals and slots are one of the fundamental building blocks of Qt. They are used to connect GUI elements to code. They are also used to talk between objects in an application. They form the basis of communication within a Qt application. Therefore, we should spend a little time learning about them.
We will start with a quick overview. Then we will look at how they can be used outside of the GUI. After that, we will see how we can use lambda functions with them. Finally, we will learn about direct and queued connections between signals and slots.