I want a paradigm in Qt4 (PyQt4), where a component is able to respond to a signal without knowing anything about where it came from.
My internal reading suggests that I should explicitly connect the signals to the slots. But I want any of several components to be able to send a signal and process it with another component.
Comparing with other tools, for example, in wxWidgets I will use events. They are automatically distributed from child windows / objects to parents. At each level they can be processed. This means that if I have many children who can emit the same event, I do not need to explicitly associate them with the handler. I can just put the handler in the parent or some higher level in the window hierarchy. This means that only the event generator and the consumer should know about the event in general. The consumer does not need to know where the source of the event is, how many such sources are there or something else.
Is this possible in Qt - is there a different approach? Maybe there is an alternative event mechanism for signals and slots?
source
share