How can I transform QTime to QTimer so I could print the left time to qDebug
?
Here's some code:
QTime time = QTime::fromString("23:54", "hh:mm");
How can I take one second away from time every second and print the left time to qDebug
?
How can I transform QTime to QTimer so I could print the left time to qDebug
?
Here's some code:
QTime time = QTime::fromString("23:54", "hh:mm");
How can I take one second away from time every second and print the left time to qDebug
?
Copyright © 2021 Jogjafile Inc.
You just have to use a
QTimer
that triggers every second, then you must decrease the time withaddSecs(-1)
and print it in an appropriate format: