[Qt-interest] How to iterate over receivers connected to a signal?

Tom Panning lurchvt at gmail.com
Thu Jun 18 17:05:59 CEST 2009


On Thu, Jun 18, 2009 at 10:56 AM, Dave Schuhman<dave130980 at hotmail.com> wrote:
> Hi,
>
> Problem:
> How do I iterate over all receivers which have been connected to a signal of
> a QObject?

The short answer is: you can't. Qt purposefully doesn't provide this
since a "well-written" program shouldn't need it. The logic is similar
to why you can't know what function called the current function. That
being said, it would be really handy for debugging purposes (just like
stacktraces are invaluable). Someone else on the list may be able to
give a more detailed work-around.

Tom



More information about the Qt-interest-old mailing list