Signal and slot basics
A signal is a special property of an object that can be emitted in response to a type of event. An event may be something such as a user action, a timeout, or the completion of an asynchronous method call.
Slots are object methods that can receive a signal and act in response to it. We connect signals to slots in order to configure our application's response to an event.
All classes descended from QObject (which accounts for most classes in Qt, including all QWidget classes) can send and receive signals. Each different class has its own set of signals and slots appropriate for the function of that class.
For example, QPushButton has a clicked signal that is emitted whenever the button is clicked by a user. The QWidget ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access