[Qt-interest] Qt::AutoConnection fails

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Tue Apr 14 18:07:41 CEST 2009


Stefan Bisplinghoff wrote on Tuesday, April 14, 2009 3:55 PM:

> Oliver.Knoll at comit.ch schrieb:
>> In order for queued connections to work the *receiving* thread (in
>> your example that would be the "main" thread - but make sure your
>> real code also behaves like this) needs to have an event queue
>> running: http://doc.trolltech.com/4.5/qthread.html#exec
> 
> Actually my worker thread has no event queue as it really doesn't
> need one. 

That's why I *emphasized* the word *receiving* ;) In your case the emitting thread is your worker thread and the *receiving* thread is your "main" thread. And I am pretty sure your "main" thread as a QApplication object, on which you called exec(), right? (Just to make sure).

So yes, in your case your worker thread does *not* need a running event queue. So in case you do have QApplication::exec() called in your "main" thread I don't know why your slot is not being called. How do you figure out anyway? I guess you have some qDebug << "I am called." statement and made sure that stdout/err output is visible on some console (in case you're doing this on Windows)?

Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list