title: Qt QLCDNumber Timer
body: <p>I have made a timer using QLCDNumber to be displayed on my status bar. I have tried to connect to my slot. However, it seems like the slot never ever get called. Can anyone advise me on what has gone wrong?</p>
  
  <p>Thanks.</p>
  
  <p>By the way, if I were to use this approach, will the timer be counting up according to how a clock time is ticking? (i.e. when the seconds reach 59, it will reset to 0, and minutes will turn 1.)</p>
  
  <p>My .h:</p>
  
  <pre><code>class StatusBar : public QStatusBar, QLCDNumber
  {
      Q_OBJECT
  public:
      StatusBar()
      {
          m_simulation = 0;
          createButtons();
      };
      ~StatusBar() { };
  
  public slots:
      void countUp();
  
  private:
      QLCDNumber *lcdSimulation;
      int m_simulation;
      QTimer *simulationTimer;
  };
  </code></pre>
  
  <p>My .cpp:</p>
  
  <pre><code>void StatusBar::createButtons()
  {
      ...
  
      lcdSimulation = new QLCDNumber;
      lcdSimulation-&gt;setNumDigits(8);
      lcdSimulation-&gt;display("12:00:00");
      simulationTimer = new QTimer;
      simulationTimer-&gt;start(5000);
      QObject::connect(simulationTimer, SIGNAL(timeout()), lcdSimulation, SLOT(countUp()));
      addWidget(lcdSimulation);
  
      ...
  }
  
  void StatusBar::countUp()
  {
      m_simulation++;
      lcdSimulation-&gt;display(m_simulation);
  }
  </code></pre>