[Qt-interest] Waiting for the Timer to emit Siganl timeout()

sujan dasmahapatra sujan.dasmahapatra at gmail.com
Mon Jun 21 20:55:26 CEST 2010


Dear Friends
I have a QTimer started, now I want wait till the timeout() signal emitted,
how can I hang the program for a certain period of time but the timer
started should keep emitting its signal. I am not sure how to achieve this ,
I have been trying something like this.



 


MainWindow::startTimer() {
QTimer * timer = new QTimer(this);
connect(timer,SIGNAL(timeout()),this,SLOT(updateLocalSlot () ));
timer->start(60000);
}
MainWindow::updateLocalSlot()
{
if() // if the job is done then 
{
timer->stop();
}
else // wait for the next signal to be emitted after 1 min
{

QWaitCondition waitcondition;

Qmutex mutex;
waitcondition.wait(&mutex);
// Here the problem when its coming here its waiting for an uncertain time
its not able to capture the timeout()
// signal anymore..... How can I achieve this please give me some hint fi
anyone knows. Thanks
}
}

 

Thanks & Regards
Sujan Dasmahapatra
B.E. (Aeronautics)
Bangalore, India
Ph:91-9900839788
Office:91-80-66470248
mail id : sujan.dasmahapatra at gmail.com
yahoo msn : dasmahapatra.aerodynamics at yahoo.co.in
icq # 556023244
skype:sujan.dasmahapatra at skyepe.com
msn: sujan.dasmahapatra at hotmail.com

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100622/187e1511/attachment.html 


More information about the Qt-interest-old mailing list