[Qt-interest] QCoreApplication derived class' slots not being called

Thiago Macieira thiago.macieira at trolltech.com
Sat Jan 24 17:19:45 CET 2009


Andrea Franceschini wrote:
>Maybe I found a feasible solution which seems to me feasible and
>doesn't require to override QCoreApplication::exec().
>
>int main(int argc, char** argv) {
>   Application a(argc, argv);
>   int r = a.exec();
>   a.thread()->wait();
>   return r;
>}
>
>It has the expected behaviour, but is this the right way to go?

There was no thread in your previous example. Where did this one come 
from? Also, from your description, you also don't seem to need a thread. 
And, what's more, you're *still* calling exec(), so I am completely 
confused now (you said you didn't need to call it).

Also note that you're waiting for a thread to finish from inside that 
thread. Don't you get a warning printed, "QThread::wait: Thread tried to 
wait on itself" ?

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Software Engineer - Nokia, Qt Software
  Qt Software is hiring - ask me
      Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090124/c3f55c66/attachment.bin 


More information about the Qt-interest-old mailing list