PDA

View Full Version : using function pointers and callback functions



ehnuh
5th November 2012, 10:25
Hi could anyone give me a simple reference to function pointers and callback functions in qt?

are signal slots and callback functions different from each other?

thanks!

pkj
5th November 2012, 10:32
Signal slots are different from function pointers in the way it has been implemented. Although the purpose of both of 'em is the same.
Signal slots are easier to understand and implement. If you are largely using qt classes, it proves very helpful. However, it is slower than the function pointers as there are a few extra function calls.
The speed however is immaterial in most of the cases because the percentage gain of using function pointers in most cases is not significant.

Santosh Reddy
5th November 2012, 11:00
are signal slots and callback functions different from each other?
Signals and Slots are built on top of callback concept, with added features like type safety, signal-to-signal, multi-slots, and cross-thread etc. At the core both Signals and Slots are plain C++ funcation calls (member functions)