[Interest] Is it OK to emit from different thread?

Konstantin Shegunov kshegunov at gmail.com
Fri Nov 30 22:50:22 CET 2018


On Fri, Nov 30, 2018 at 11:34 PM Jérôme Godbout <godboutj at amotus.ca> wrote:

> While I agree with your point, it’s easy to shoot yourself in the foot as
> soon as one add a slots into that QThread inherited class (can see the kdab
> recommendation on the subject point #5:
> https://www.kdab.com/nailing-13-signal-slot-mistakes-clazy-1-3/ ). Your
> green developer will be tempted to add a slots into this object if they
> feel they need a slots and there the fun will be over. Having to specify
> your connect() not auto is very rare.
>

Probably, but as it happens it's almost always easier to shoot yourself in
the foot than to avoid it. And while subclassing QThread isn't the best way
99.5% of cases, it's still a valid approach, so it should not be summarily
dismissed.

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20181130/c5b7e5ca/attachment.html>


More information about the Interest mailing list