Hello anyone,
I ám a newbie,
I have a question about QTime and QTimer.
I have read the posts in the forum about QTime and Qtimer but it gives me not the solution that i want.
I want to countdown the Time(not the currentTime)in lcdNumber. Example(05:00:00->04:59:59...)
Is it possible to do it in QTime ?.
See my implentation:
countdownDialog
::countdownDialog(QWidget *parent
)
{
setupUi(this);
connect(timer, SIGNAL(timeout()), this, SLOT(displayTime()));
timer->start(1000);
}
void countdownDialog::displayTime()
{
time->setHMS(5,0,0,0);
lcdNumber->display(time->toString());
}
Thanks in advance.
countdownDialog::countdownDialog(QWidget *parent)
:QDialog(parent)
{
setupUi(this);
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(displayTime()));
timer->start(1000);
}
void countdownDialog::displayTime()
{
QTime *time = new QTime();
time->setHMS(5,0,0,0);
lcdNumber->display(time->toString());
}
Thanks in advance.
To copy to clipboard, switch view to plain text mode
Bookmarks