1、cannot initialize a parameter of type ‘QWidget *’with an rvalue of type 'Core *'
出问题的地方是构造函数中开头:ui->setupUi(this);//this错误
调试用发现问题是头文件中变量声明使用了BOOL,将BOOL修改为bool就不提示报错了
2、use of nudeclared identifier 'Sleep'
Sleep(100)修改为QThread::msleep(100);
本文解决了两个Qt编程中常见的问题:一是无法使用rvalue初始化QWidget指针参数的问题,通过修正头文件中的布尔类型定义得以解决;二是针对Sleep宏未声明的情况,采用QThread::msleep替代。
1、cannot initialize a parameter of type ‘QWidget *’with an rvalue of type 'Core *'
出问题的地方是构造函数中开头:ui->setupUi(this);//this错误
调试用发现问题是头文件中变量声明使用了BOOL,将BOOL修改为bool就不提示报错了
2、use of nudeclared identifier 'Sleep'
Sleep(100)修改为QThread::msleep(100);
3104

被折叠的 条评论
为什么被折叠?