[Qt-interest] QThread event loop running in main thread?

Tom Russo tom.km5vy at gmail.com
Mon Dec 27 19:48:36 CET 2010


On Mon, Dec 27, 2010 at 09:52,  BRM <bm_witness at yahoo.com> wrote:
> Thus far, I've done:
>
[...]
> - Used QThread without modification, but found I had to run moveToThread()
> before connecting the signals/slots to get it to work - or at least that's what
> it seemed like (Qt 4.5.1).
>
> Two very different models, but neither have any good examples in the Qt
> documentation. That said, I have come across several very good blog posts on Qt
> Labs per QThreading - one of which is what converted me to start using the
> second model above (no QThread derivatives), though I can't seem to find it
> right now.

You might mean this one?

http://labs.qt.nokia.com/2006/12/04/threading-without-the-headache/

The  modification of run() described in the blog is now the default
behavior in Qt, so subclassing is not strictly required anymore (the
default run() implementation now calls exec()).  But the documentation
of QThread still says that it must be subclassed to be used.



-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 http://kevan.org/brain.cgi?DDTNM
 "The truth will set you free, but first it will piss you off."



More information about the Qt-interest-old mailing list