1、问题遇到的现象和发生背景
在Qt中,网课上可以跑,但是我下载的他的源码就不能跑。
2、部分源码
connect(startBtn,&MyPushButton::clicked,[=](){
startBtn->zoom1();
startBtn->zoom2();
//延时进入到选择关卡场景
QTimer::singleShot(500,this,[=](){
this->hide(); //自身隐藏
chooseScene->show(); //选择关卡场景显示
});
});
3、运行结果及报错内容
no matching function for call to ' QTimer::singleShot(int ,MainScene *,MainScene::MainScene(QWidget *)::lambda_7::lambda_8 )'
4、我的解答思路和尝试过的方法
(1) 我在 . pro文件中添加了CONFIG +=C++11
检查添加头文件了吗
#include <QObject>