Thursday, February 8, 2018

Timer or Stopwatch?

A well known feature of Qt framework (at least what I guess) is the QTimer class, which essentially allows to have repetitive tasks or calculations at a given time interval. Think of it as a timer, that when it goes off, sends the timeout() signal and starts again the countdown for another interval. But a less known feature (at least what I guess) is the QElapsedTimer class, which acts the opposite: once started, you can know the elapsed time since that moment by calling the ellapsed() method.
So if time goes back or forth in your application, Qt framework have you covered in any case. Happy clocking!

No comments:

Post a Comment