[Interest] Emitting signal from QThread::run()

Thiago Macieira thiago.macieira at intel.com
Mon Feb 29 17:48:07 CET 2016


On segunda-feira, 29 de fevereiro de 2016 16:37:46 PST Prav wrote:
> Why you so easily mixed "signals and slots" in this statement.
> Signals are NOT slots ... so if slots in subclassed from QThread object
> usually gives not what people naturally expect, it does not mean that
> signals are dangerous too.
> 
> Signals are just methods like any user's calculation code. What is wrong
> with them? So without argumentation I do not get why signals in
> QThread::run() is better to avoid.

The argument is *because* it confuses people. You're right in your statement 
that signals are not slots and that the code actually works. But people keep 
asking about the thread affinity of the sender class (the QThread-derived one), 
which is irrelevant in the context.

It's not a matter of "works". It's a matter of "confusing".

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list