用法如下: //参数:(定时时间,接受者,槽函数) QTimer::singleShot(1000,this,[=]{ //想要执行的代码 qDebug() << "hello world" ; });