[Interest] QThreads: There's no one way to "do it right"! :)

Konstantin Tokarev annulen at yandex.ru
Wed Jan 23 09:30:43 CET 2013



23.01.2013, 12:29, "alexander golks" <alex at golks.de>:
> Am Wed, 23 Jan 2013 11:56:55 +0400
> schrieb Konstantin Tokarev <annulen at yandex.ru>:
>
>>>  My rule of thumb is that, if you're doing a simple but compute
>>>  intensive task where you don't want communication via signal/slots
>>>  (probably thats what the author of the last post meant by not needing
>>>  event loop), go with subclassing QThread.
>>  Actually, you *can* communicate with outside world by emitting signals
>>  in this approach. What you maybe should not do is to have slots in your
>>  thread class because they *won't* run in the working thread.
>
> but if you connect them queued, then they are executed in the thread, or not?

Of course no (unless you are using moveToThread(this) which you shouldn't).

>
> personally i use qthread the way it fits best at my current project. in the
> end it depends on how you design and setup your threaded worker.
>
> --
>
> ,
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-- 
Regards,
Konstantin



More information about the Interest mailing list