I have a QtSDK timer, but when it starts time goes absurdly faster than normal . Here is the code below:
QTime time;
QTimer timer;
void PlanejamentoWidget::timeUpdate(){
QTime t = ui.timeEdit->time();
ui.timeEdit->setTime(t.addMSecs(time.elapsed()));
}
void PlanejamentoWidget::startTimer(){
if (timer.isActive()){
ui.btStart->setText("Iniciar");
timer.stop();
}
else{
ui.btStart->setText("Parar");
time.start();
timer.start(60);
}
}
void PlanejamentoWidget::restartTimer(){
time.restart();
QTime t;
t.setHMS(0, 0, 0, 0);
ui.timeEdit->setTime(t);
}
Does anyone have any idea what it might be? Thank you.