[Interest] Using a single shared Object as a message bus throughout the application?

Tarre Tarkas mail.tarre at simplelogin.co
Thu Jun 10 20:21:33 CEST 2021


In my case I will keep local state contained inside, not individual 
buses, but I see your point.

I actually much prefer Qt's API to the C++ standard library, so I don't 
see the avoidance of Qt as a benefit, if anything it's a disadvantage. I 
build all my C++ programs in Qt. I also love the automatic thread-safety 
(in most cases) between the signal emitter and the signal handler, where 
Qt creates a copy of the argument if it detects the handler is on a 
different thread.

I looked at dedicated event bus libraries on Github and I'm not seeing 
what benefit they provide over a shared QObject. My components are 
already all QObjects.

For "get or create" a bus, that's a nice idea, I guess I can have 
components call a "QObject* getOrCreateBus(BusesEnum bus)" function.

(Sorry for the private email Jerome, this is my 1st time on a mailing 
list)

On 2021-06-09 16:13, Jérôme Godbout - godboutj at amotus.ca wrote:
> ...snip
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest


More information about the Interest mailing list