hakermania
8th January 2011, 10:39
Hello all, i would like to tell me what's wrong with this code
for(int a=9;a>=0;a--)
{
ui->label->setText((QString)a);
ui->label->repaint();
sleep(1);
}
where sleep(const int) is the function from the iostream library and waits const int seconds till the next step.
The label isn't repainted :/
So, actually it is a label that must change its value every second. Thanks :)
Added after 39 minutes:
For anybody following this thread, the solution is to use a QTimer :)
for(int a=9;a>=0;a--)
{
ui->label->setText((QString)a);
ui->label->repaint();
sleep(1);
}
where sleep(const int) is the function from the iostream library and waits const int seconds till the next step.
The label isn't repainted :/
So, actually it is a label that must change its value every second. Thanks :)
Added after 39 minutes:
For anybody following this thread, the solution is to use a QTimer :)