munna
12th September 2006, 11:53
Hi,
I have a console application in which I have reimplemented QCoreApplication. Also, I am creating n(sent as an argument) threads in the following manner
Thread *t = new Thread(ipAdd, serialNo, noOfSecs, perSec);
++threadCount;
connect(t, SIGNAL(finished()), this, SLOT(threadFinished()));
connect(t, SIGNAL(finished()), t, SLOT(deleteLater()));
t->start();
Here is the slot threadFinished()
void Application::threadFinished()
{
--threadCount;
if(threadCount == 0){
exit();
}
}
The above slot is never called itself and therefore I am not able to exit from the application.
Can someone please help me with this ?
Thanks a lot.
I have a console application in which I have reimplemented QCoreApplication. Also, I am creating n(sent as an argument) threads in the following manner
Thread *t = new Thread(ipAdd, serialNo, noOfSecs, perSec);
++threadCount;
connect(t, SIGNAL(finished()), this, SLOT(threadFinished()));
connect(t, SIGNAL(finished()), t, SLOT(deleteLater()));
t->start();
Here is the slot threadFinished()
void Application::threadFinished()
{
--threadCount;
if(threadCount == 0){
exit();
}
}
The above slot is never called itself and therefore I am not able to exit from the application.
Can someone please help me with this ?
Thanks a lot.