Signals and slots

Signals and slots is a language construct introduced in Qt[1] for communication between objects which makes it easy to implement the observer pattern while avoiding boilerplate code.

This is similar to C/C++ function pointers, but the signal/slot system ensures the type-correctness of callback arguments.

[citation needed] Similarly, the signal/slot system can be used for other non-GUI usages, for example asynchronous I/O (including sockets, pipes, serial devices, etc.)

There are some implementations of signal/slot systems based on C++ templates, which don't require the extra metaobject compiler, as used by Qt, such as libsigc++, sigslot, vdk-signals, nano-signal-slot, neosigslot, Signals, boost.signals2, Synapse, Cpp::Events, Platinum, JBroadcaster and KDBindings.

Additionally, a delegate can be a local variable, much like a function pointer, while a slot in Qt must be a class member declared as such.