qt 中结构体添加构造函数后报错
我定义了一个结构体并添加了构造函数:
struct DataInfo{
GLenum type;
const char* filename;
int note;
DataInfo(){
type = 0;
filename = nullptr;
note = 0;
}
};
但是在初始化一个结构体时:
DataInfo pain = {1,"../texture/red.file",null};
qt报错:could not convert '{1, "../texture/red.file"}' from 'brace-enclosed initializer list' to 'ShaderInfo'