Qt中如何设置循环自动点击pushbutton

2024-11-29 17:47:41
推荐回答(1个)
回答(1):

#include

QTimer *timer=new QTimer;
connect(timer, &QTimer::timeout, this, [&伏唤](){
//5秒调用一次,想干缺神凯啥都行
//假设按钮瞎唤是pushButton
pushButton->click();
});
timer->start(5000);