Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Talk:Understanding Signals and Slot in Qt
Signals and slots are one of the powerful feature of Qt. It enables communication between objects, irrespective of type of object. Other frameworks achieve this type of communication by callbacks, but they are not type-safe and the callback is strongly coupled to the processing function since the processing function must know which callback to call.
A signal is emitted when a particular event occurs. A slot is a function that is called in response to a particular signal. The signals and slots mechanism is type safe: The signature of a signal must match the signature of the receiving slot.The signals and slots mechanism is type safe: The signature of a signal must match the signature of the receiving slot. Signals and slots are loosely coupled: A class which emits a signal neither knows nor cares which slots receive the signal.
This article explains in the concept of signal and slots in brief. A code shows how sender will send signals and receiver receive that signals using slots, for example sender object,spinBox , will emit signal valueChanged() which receiver object ,slider , will receive in setValue().
Although this article does not have detailed explanation of signals and slots mechanism, the example given explains how this mechanism will works. Before starting programming in Qt one must learn this mechanism.