Is there a way to stop execution of a slot/function when a signal is emitted?