QTimer使用
//添加头文件
#include <QTimer>
//定时器实例化
QTimer *T;
T = new QTimer(this);
//设定定时周期 1S
read_plc_time->setInterval(1);
//启动
read_plc_time->start();
//监听定时器完成后执行槽函数
connect(T,&QTimer::timeout,this,&Test::Interposing_out);
//或
connect(T,&QTimer::timeout,[=](){
//定时器完成动作
});