C++ (Qt) #include <QTime> #include <QTimer> ...... int hor = ui->lineEdit_hour->text().toInt(); int min = ui->lineEdit_min-> text().toInt(); int sec = ui->lineEdit_sec-> text().toInt(); QString text = QTime(hor, min, sec).toString("hh:mm:ss"); ui->lcdNumber->display(text);
C++ (Qt) ... ... sec--; if(sec < 0) {min--; sec = 59;} if(min < 0) {hor--; min = 59;} .... ...
C++ (Qt)06 QTime time = timeEdit->time();07 int secs = (time.minute() * 60) + time.second();