Unsolved Add a stopwatch in QTwidget application.
-
Hello Everyone!
I am new to QT and C++ programming. I have tried to develop a simple app in qt written in c++. I want to add a stopwatch in my app. When I run my app the stopwatch starts and display it on app as well. How can I write a code for it? Can somebody help me?
TIA
-
Hi
Which part do you need help with ?
You can use a QTimer + qelapsedtimer for keeping track of time.
https://doc.qt.io/qt-5/qelapsedtimer.htmlhttps://forum.qt.io/topic/75609/proper-way-to-code-a-stopwatch
Or you can use QDateTime as in this example
https://github.com/jesslarsen21/stopwatch-QT/tree/master/a5-erik-jessica-stopwatch