Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Building a timer
I am working on building an app in which when a mouse area is clicked a timer starts and on clicking the other button the timer stops. I am having problems in including the timer. I tried using NumberAnimation but it does not work properly. Kindly help
koahnig last edited by
welcome to devnet
You might want to have a look on to "QTime::currentTime()":http://qt-project.org/doc/qt-4.8/qtime.html#currentTime
The difference of 2 time readings shall provide you the result you are looking for.
Thank you Koahnig for the reply
I looked into the link given by you, but couldn't use it in code as I am not sure in which file I should include it.
steno last edited by
You have to include QTime in the file you make the call in.
I included QTime in the file and included the timer.h and timer.cpp file, but i am still not getting the output when i build the code.
The Timer is working properly. Thanks everyone for the support.