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:
Qt Code:
  1. countdownDialog::countdownDialog(QWidget *parent)
  2. :QDialog(parent)
  3.  
  4. {
  5.  
  6. setupUi(this);
  7.  
  8.  
  9. QTimer *timer = new QTimer(this);
  10. connect(timer, SIGNAL(timeout()), this, SLOT(displayTime()));
  11. timer->start(1000);
  12.  
  13. }
  14. void countdownDialog::displayTime()
  15. {
  16. QTime *time = new QTime();
  17. time->setHMS(5,0,0,0);
  18. lcdNumber->display(time->toString());
  19.  
  20. }
  21.  
  22. Thanks in advance.
To copy to clipboard, switch view to plain text mode