Let's start with fixing an obvious memory leak. Here "time" is allocated on the heap but never deleted:
Quote Originally Posted by dragon View Post
Qt Code:
  1. void countdownDialog::displayTime()
  2. {
  3. QTime *time = new QTime();
  4. time->setHMS(5,0,0,0);
  5. lcdNumber->display(time->toString());
  6. }
To copy to clipboard, switch view to plain text mode 
Just for the learning purposes, you should start with rewriting it as:
Qt Code:
  1. void countdownDialog::displayTime()
  2. {
  3. QTime time;
  4. time.setHMS(5,0,0,0);
  5. lcdNumber->display(time.toString());
  6. }
To copy to clipboard, switch view to plain text mode 
Now, "time" get automatically destructed while going out of scope.

The next thing is to actually implement some counter functionality. All the above code does is converting the same time (05:00:00) over and over again to a string and setting it to the lcd number widget. You could make the time object a member variable instead and reduce a second every iteration:
Qt Code:
  1. class countdownDialog
  2. {
  3. ...
  4. private:
  5. QTime time; // declare a member variable
  6. }
  7.  
  8. countdownDialog::countdownDialog(QWidget *parent)
  9. :QDialog(parent)
  10. {
  11. ...
  12. // initialize it to anything you want,
  13. // for example 5 hours as you did before in displayTime()
  14. time = QTime(5, 0, 0, 0);
  15. }
  16.  
  17. void countdownDialog::displayTime()
  18. {
  19. time = time.addSecs(-1); // reduce a second
  20. lcdNumber->display(time.toString());
  21. }
To copy to clipboard, switch view to plain text mode