Oh, k sorry.
On that note I would say eh… it would be more readable to show ownership of the signal. It could become a nightmare to trace.
Signals cam use the same callable function
Foo.connect.pressed(self._on_child_pressed)
Foo2.connect.pressed(self._on_child_pressed)
Connecting a signal this way would also make the children signals “private” with the parent. If done the proposed way above, adjacent Nodes to the parent could also listen for that signal of the buttons as a side effect of the child emitting on behalf of the parent. (Maybe parent child is incorrect, it could be delegate and owner of signal)
But if you had such a need to do this you could also just have a cascade of emitting signals. One from the button, then one from the parent that a button was pressed.
…
I don’t know if that while loop is just for demonstration purposes, but seems like an anti-pattern for how signals want to work. Just connect a callable function to the signal.