[Qt-interest] Waiting for the Timer to emit Siganl timeout()
Jason H
scorp1us at yahoo.com
Mon Jun 21 21:13:58 CEST 2010
Why would you want to hang the program?
If its not done in 60 seconds, you're going to bring everything to a halt until it is done??
Why not just wait another 60 seconds?
You also might want to look at libQxt's QxtSignalWaiter class.
________________________________
From: sujan dasmahapatra <sujan.dasmahapatra at gmail.com>
To: qt-interest at trolltech.com
Sent: Mon, June 21, 2010 2:55:26 PM
Subject: [Qt-interest] Waiting for the Timer to emit Siganl timeout()
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/20100621/5061e3a3/attachment.html
More information about the Qt-interest-old
mailing list