void MainWindow::updateETLabel(){
setETLabelText(text);
}
//MainWindow constructor:
connect(ETTimer,SIGNAL(timeout()),this,SLOT(updateETLabel()));
//StartButton:
ETTimer->start(1000);
void MainWindow::updateETLabel(){
QString text = QTime::currentTime().toString("hh:mm:ss");
setETLabelText(text);
}
//MainWindow constructor:
ETTimer = new QTimer(this);
connect(ETTimer,SIGNAL(timeout()),this,SLOT(updateETLabel()));
//StartButton:
ETTimer->start(1000);
To copy to clipboard, switch view to plain text mode
the code above not works of course, because "QTime::currentTime().toString("hh:mm:ss");" only returns the current time...
I wanna make a timer that starts from 00:00:00 and increase each second. But I dont know how to do it in QT. Please I really need your help!
Bookmarks