Signals and slots
In Qt, this action-response scheme is handled by signals and slots. This section will include a few definitions, and then we shall jump into an example for further explanation.
A signal is a message that is passed to communicate that the state of an object has changed. This signal may carry information about the change that has occurred. For instance, when a window has been resized, the signal will usually carry the coordinates of the new state (or size) of the window. Sometimes, a signal may carry no extra information, such as that of a button click.
A slot is a specific function of an object that is called whenever a certain signal has been emitted. Since slots are functions, they will embody lines of code that perform ...
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