title: Making count down timer in Qt
body: <p>So, I <em>found</em> something working here, and I wish to understand how it works.</p>
  
  <pre><code>#ifndef  LCDNUMBER_H
  #define LCDNUMBER_H
  
  #include &lt;QLCDNumber&gt;
  #include &lt;QTimer&gt;
  #include &lt;QTime&gt;
  #include &lt;iostream&gt;
  
  class lcdDisplay : public QLCDNumber
  {
      Q_OBJECT  
  
      public:
          // The QTimer class provides repetitive and single-shot timers.
          QTimer* objTimer;
          // The QTime class provides clock time functions.
          QTime*  objTime;
  
      public:
          lcdDisplay (QWidget *parentWidget, int minutes, int seconds)
          {
              objTimer = new QTimer ();
              // Setting our own time with the specified hours, minutes, and seconds.
              objTime  = new QTime  (0, minutes, seconds);
  
              setParent (parentWidget);
  
              // connect (objectA, signalAFromObjectA, objectB, slotAFromObjectB)
              // timeout (): This signal is emitted when the timer times out. The time out period can be specified with `start (int milliseconds)` function.
              QObject :: connect (objTimer, SIGNAL (timeout ()), this, SLOT (setDisplay ()));
          };
  
          ~ lcdDisplay () {};
  
      public slots:
          // This slot is called after the timer timeouts (1 second).
          void setDisplay ()
          {
              std::cout &lt;&lt; "\nf,gfd,mgnfdm,gnf,\n";
              // 
              objTime-&gt;setHMS (0, objTime-&gt;addSecs (-1).minute (), objTime-&gt;addSecs (-1).second ());
              display (objTime-&gt;toString ());
          };
  };
  #endif
  </code></pre>
  
  <p>I wish to understand this line: <code>objTime-&gt;setHMS (0, objTime-&gt;addSecs (-1).minute (), objTime-&gt;addSecs (-1).second ());</code></p>
  
  <p>How does this decrease the minutes and seconds internally?<br>
  From here: <a href="http://doc.qt.nokia.com/4.7/qtime.html#addSecs" rel="nofollow">http://doc.qt.nokia.com/4.7/qtime.html#addSecs</a></p>
  
  <blockquote>
    <p>QTime n(14, 0, 0);                // n == 14:00:00<br>
     QTime t;<br>
     t = n.addSecs(70);                // t == 14:01:10<br>
     t = n.addSecs(-70);               // t == 13:58:50  </p>
  </blockquote>
  
  <p><code>addSecs</code> function perhaps adds or subtracts seconds. Fine. but does this do <code>objTime-&gt;addSecs (-1).minute (),</code>?  </p>
  
  <p>How does <code>setHMS</code> work?</p>