PDA

View Full Version : Which of the two ways of emitting a signal from a derived class is better?



piotr.dobrogost
14th August 2009, 21:15
Which of the following two ways of emitting a signal from my class which inherits from some class with signals is better and why?

1. Emitting my signal from within overridden method of a base class like QAbstractState::onEntry().

2. Creating handler for base class' signal like QAbstractState::entered(), connecting the signal with the handler and emitting my signal from within this handler.

wysota
14th August 2009, 21:17
It doesn't matter. The second solution though enables someone to disconnect the signal if (s)he wants to. This might be both a good or a bad thing :)