I have a situation where I need to post a certain dialog from multiple places in my application, some at the top level (a MainWindow menu command), some buried deep in the hierarchy of GUI layers or in dialogs. For re-usability and maintenance purposes, I want to avoid having some low-level dialog need to know about a MainWindow instance in order to make a connection, as well as avoiding having to relay a signal up to the top level through a series of signals implemented in parents of the low-level class.

I would also like to avoid having all the low-level classes know that it's a dialog that needs to be posted. I just want them to be able to emit a signal that says something generic, like "doThisThing" and somewhere above it, some object sees that signal and says, I don't know who sent this, but I'll "doTheThing".

Normal signal-slot connections are point-to-point, that is, a connection is between a specific sender and receiver (which could be a lambda).

Is there any mechanism in Qt for signal broadcasting? That is, where a QObject instance could emit a signal, and another QObject instance could connect a slot to that signal, but where the instance sending the signal is not known at the time the connection is made? A connection of the form:

Qt Code:
  1. connect( &someSignal, this, &MyClass::mySlot );
To copy to clipboard, switch view to plain text mode 

Or am I confused and this is just another case of the famous "ComeFrom" statement in BASIC?