multithreading - Emit signals or post events from QRunnable -
is emitting signals inside qrunnable::run() right thing do? need inform gui thread image processed qrunnable done. using qthreadpool/qrunnable because need able add new tasks pool while there tasks in already. find kind of hard qtconcurrent , qfuturewatcher.
the qrunnable using qobject created in run() connect target qobject , emit signals.
if emitting qrunnable not thing, possible post events there?
yes, emitting signals , posting events fine things in qrunnable::run() because both thread-safe. signals , events handled properly, qobjects must have correct thread affinity. see threads , qobjects more details.
Comments
Post a Comment