Qt定时器

QTimer *timer;
//构造函数里
timer = new QTimer(this);
//相应的槽函数
timer->setInterval(1000);//设置定时时间
timer->start();//开始计时
timer->stop();//停止计时
//定时时间到槽函数
connect(timer,&QTimer::timeout,this,&DialogTest::slotTimerTimeOut);

你可能感兴趣的:(qt,javascript,开发语言)