Could QTime used like this kind of timer?
Unsolved
General and Desktop
-
There are some device that need record they working time .So I need QTime to record the time.
const QString TIME_FORMAT = "hh:mm:ss"; //...... deviceWork_Time->addSec(100); deviceWork_Time->addSec(3600); deviceWork_Time->addSec(1800); //...... qDebug()<<"Work Time:"<<deviceWok_Time.toString(TIME_FORMAT);
The programme will tell user "Work Time:1:31:40";
In fact,the device will work continue for a few days , so I hope QTime can show like
"Work Time: 121:20:40"
Now user can know the device had work 121hours and 20 minutes and 40 second.But if the time more than 24 hours,the QTme will show the time is "0:00:00"... -
hi @qazaq408
IIRC QTime only works for 0 to 86399, aka 23h 59m and 59 sec
you can call start() on a QTime object and it will start counting the seconds, (starting with 00:00:00)to recorde more than 24 hours, you'll have to use a QDateTime object, or monitor it yourself.