Sunday, 13 July 2014

Qt


  1. Signals and slots are used for communication between objects.They are alternative to the callback technique
  2.  A signal is emitted when a particular event occurs. 
  3.  A slot is a function that is called in response to a particular signal.
  4. All classes that contain signals or slots must mention Q_OBJECT at the top of their declaration. They must also derive (directly or indirectly) from QObject.
  5. The signature of a signal must match the signature of the receiving slot. (In fact a slot may have a shorter signature than the signal it receives because it can ignore extra arguments.) Since the signatures are compatible, the compiler can help us detect type mismatches. Signals and slots are loosely coupled: A class which emits a signal neither knows nor cares which slots receive the signal. Qt's signals and slots mechanism ensures that if you connect a signal to a slot, the slot will be called with the signal's parameters at the right time. Signals and slots can take any number of arguments of any type. They are completely type safe.

No comments:

Post a Comment