QTimer
-
I am a newbie in Qt. I was working on QTimer class. I have label = 00:00:00. I setted the label using setText("12:45:50"); using a button.
When i click the start button it resets to 00:00:00 again and starts. It won't start from 12:45:50. How do i do that? -
welcome to devnet
You need to post at least some code snippet. Otherwise nobody can help you.
There are also the examples eg "Analog Clock":http://qt-project.org/doc/qt-4.8/widgets-analogclock.html and "Digital Clock":http://qt-project.org/doc/qt-4.8/widgets-digitalclock.html -
BTW: QTimer is used to trigger a Signal after a certain period of time or at regular intervals. If you want the current time, as it appears from your setText() command, you may want to have a look at QDateTime::currentDateTime(). If you need a string you can pass into setText(), use .time().toString().
-
I solved the problem myself. Thanks for the replies!