QTimer类
QTimer *timer = new QTimer(this) ;
timer->start(1000); //时间到就会发出个信号,&QTimer::timeout
connect(timer , &QTimer::timeout,[=](){
static int num = 1;
ui->labelshowtime->setText(QString::number(num ++));
});
2024-02-17 14:17:40
QTimer类
QTimer *timer = new QTimer(this) ;
timer->start(1000); //时间到就会发出个信号,&QTimer::timeout
connect(timer , &QTimer::timeout,[=](){
static int num = 1;
ui->labelshowtime->setText(QString::number(num ++));
});