1、添加头文件
#include <QTimer>
2、可以在定义QTimer变量
QTimer *timer;
3、在某函数或构造函数中添加
timer = new QTimer(this);
connect(timer ,SIGNAL(timeout()),this,SLOT(doSomething()));
timer->start(200); //200Ms执行一次
4、添加槽函数
void doSomething()
5、停止定时器操作
timer->stop();