Signals and slots

From Wikipedia, the free encyclopedia

Signals and slots is a software design pattern introduced in Qt by the moc. The concept is that controls (also known as widgets) can send signals containing event information (e.g. the text "toto" was selected, the scrollbar has been adjusted to value 37) which can be received by other controls using special functions known as slots. The signal/slot system fits well with the way Graphical User Interfaces are designed. Similarly, the signal/slot system can be used for asynchronous I/O (including sockets, pipes, serial devices, etc.) event notification or to associate timeout events with appropriate object instances and methods or functions. A signal to slot connection is the equivalent of the Design Pattern Observer.

There are several implementations of signal/slot systems based on C++ templates, such as libsigc++ and boost.signals.

[edit] See also

[edit] References

In other languages