adamatic
18th March 2009, 10:52
Hello.
I am implementing a QTimer and my intention is to wait in a while loop until any of two conditins is true. One is refering to my aplication and is going to be all the time true, and the other condition is true until the timer have expired.
This is more or less the code which I am refering:
timer2= new QTimer(); // timer2 is a global QTimer
timer2->setSingleShot(true);
connect(timer2, SIGNAL(timeout()),this, SLOT(go()));
timer2->start(10000);
while( true && timer2->isActive()){
}
The problem is that the execution is all the time at the while loop and it is never conitnued, because although the time in running the timer2->isActive returns always true. And it is never gone to the SLOT go().
I have read that there is a qt bug related with this but it is resolved. I am using QT 4.4.4 on Windows Xp.
Cheers, and thank you in advance.
I am implementing a QTimer and my intention is to wait in a while loop until any of two conditins is true. One is refering to my aplication and is going to be all the time true, and the other condition is true until the timer have expired.
This is more or less the code which I am refering:
timer2= new QTimer(); // timer2 is a global QTimer
timer2->setSingleShot(true);
connect(timer2, SIGNAL(timeout()),this, SLOT(go()));
timer2->start(10000);
while( true && timer2->isActive()){
}
The problem is that the execution is all the time at the while loop and it is never conitnued, because although the time in running the timer2->isActive returns always true. And it is never gone to the SLOT go().
I have read that there is a qt bug related with this but it is resolved. I am using QT 4.4.4 on Windows Xp.
Cheers, and thank you in advance.