I think the best approach would be to cover the structure you are using and use signal / slots.
Saying that if this code works and is not ugly or not causing problems, then you might be better off leaving it alone.
Consultation The signal / slot documentation describes why it is better to use the Signal / Slot approach:
Callbacks have two main drawbacks: First, they are not type specific. We can never be the processing function will call the callback with the correct arguments. Secondly, the callback is tightly coupled with the processing function because the processing function needs to know which callback to call.
Remember the following:
Compared to callbacks, signals and slots are slightly slower due to the greater flexibility they provide.
In most cases, speed probably doesn't matter, but there may be some extreme cases of recall that matter.
Brian R. bondy
source share