In a GUI program there are many times when the application needs to do something in response to a recent action take by the user. For example, if a user clicks a close button they probably want to close the corresponding window. In the design of the program it would be nice to have a simple mechanism connecting the mouse click to the close() method.
In CopperSpice this mechanism is implemented using a Signal / Slot relationship. A signal is emitted when a particular event occurs, such as the mouse click. A slot is usually a normal method which is called in response to the event.
Signals and Slots are used for communication between objects.
The signal and slot system is type safe and works across threads. The signal may emit any number of parameters of any copyable data type. The slot can ignore any or all of these parameters. The only constraint is that if the slot needs to receive some of the parameters the order must match those emitted by the signal.
A class which emits a signal does not need to know which slots receive the signal. All classes that inherit from QObject or one of its subclasses can contain signals and slots.