我写了一个函数大概是
func1()
{
timer1 = new QTimer(this);
timer1->singleShot(1000,this,SLOT(func2()));
timer1->stop();
}
func2()
{
timer2 = new QTimer(this);
timer2->singleShot(1000,this,SLOT(func3()));
timer2->stop();
}
func3()
{
timer3 = new QTimer(this);
timer3->singleShot(1000,this,SLOT(func3()));
timer3->stop();
}
代码使得func1运行超时1s后会触发func2,func2超时后接着触发func3,func3再触发func1,形成一个循环,我想要比如说让func1停止执行后,程序就终止,func2和func3都不再执行,希望各位能帮忙解决一下,谢谢啦!