Need something like Subscribe/Publish, but not knowing the publisher?
-
I am looking for a way for an object to receive a message, without having to connect to the a potential sender. Like if you could call connect without providing the sender, and you'd get signals no matter who the emitter was. I work with an in-house framework that has this, and it's very handy. My particular use for this is a scroll area that contains MANY widgets, and I'd like my main window to get notified when any of them are clicked on. Thanks.
-
Maybe use events ?
-
Hi,
Are you thinking of something like a QSignalMapper ?
-
I was hoping for something even simpler. As simple as
to receive:
subscribe ("some message", callThis)
to send
publish ("some message") -
AFAIK, there's nothing like that currently
-
thanks then. I wound up using a custom event. A little extra work, but it works.
-
Just remembered something, there was in the QtMobility module something about a Publish And Subscribe system. However I don't know whether it's usable in Qt 5 and applicable to your current application. But worth to take a look at