error C2248: 'QObject::QObject' : cannot access private member declared in class 'QObject'
1.error C2471: cannot update program database vc90.pdb
解决方案:https://blog.csdn.net/shuixin536/article/details/8620684
2.提示不能访问QObject的私有成员的解决办法:
class PhotosData:public DataInterface
{
Q_OBJECT
public:
PhotosData(){};
~PhotosData(){};
QPixmap PixMap() { return m_PixMap;};
void SetPixMap(QPixmap pixmap) { m_PixMap = pixmap; };
private:
QPixmap m_PixMap;
QString m_Name;
QString m_Time;
QString m_Date;
};
PhotosData *node = new PhotosData(*mediaItem); //引用了PhotosData基类的默认构造函数
group->Add(node);
继承的类要定义使用的构造函数的类型,否则会默认调用基类的构造函数,如果基类的构造函数是私有的。那就会引起报错
error C2248: 'QObject::QObject' : cannot access private member declared in class 'QObject'的更多相关文章
- CStringArray error C2248: 'CObject::CObject' : cannot access private member declared in class
在开发中将一个字符串分割,并将子字符串保存在CStringArray中,专门写了一个函数,如下: SplitStringToCString(CString str, TCHAR tszSplit, C ...
- error C2248: 'MyString::pCharArray' : cannot access private member declared in class 'MyString'
std::ostream & operator<<(std::ostream os,const MyString & mystr){os<<mystr.pCha ...
- [置顶] c++,vc6.0,中友元函数,无法访问私有字段(private)的问题(problem),cannot access private member declared in class 'Date'
c++,vc6.0,中友元函数,无法访问私有字段(private)的问题(problem),cannot access private member declared in class 'Date' ...
- error C2248: “CObject::operator =”: 不可访问 private 员(于“CObject”类声明)
MFC如果编码错误: 演出:error C2248: "CObject::operator =": 不可访问 private 员(于"CObject"类声明) ...
- VC++ error C2248: “CObject::CObject”: 无法访问 private 成员(在“CObject”类中声明)
在使用诸如:CArray或是 CList等类时,经常会出现此错误 此错误的原因是由于自定义的类的数组项时 有一个操作如 Add() 在这个操作中,实际上需要一个 = 操作,但是这个 =操作在 自定 ...
- 错误 88 error C2248: “CObject::CObject”: 无法访问 private 成员(在“CObject”类中声明) c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\afxcoll.h 590
最近接收了以前新公司遗留的代码,一个函数动不动就少的一千行,多的几千行,真是受不了这编码风格! 于是便使用了VS自带的重构工具,选择代码后右键-重构-提取方法,提取完方法就编译不过,想了好久原因,原来 ...
- java.lang.IllegalAccessException: Class XX can not access a member of class XXX with modifiers "private static"
当前需求: 利用反射获取某一属性值运行结果:java.lang.IllegalAccessException: Class com.example.demo.test.Reflect can not ...
- Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers "public"
Spring注入Action使用Json错误:org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: ...
- org.apache.struts2.json.JSONWriter can not access a member of class
偶遇一个问题:org.apache.struts2.json.JSONWriter can not access a member of class org.apache.tomcat.dbcp.db ...
随机推荐
- POJ 3067 Japan 【树状数组经典】
题目链接:POJ 3067 Japan Japan Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 32076 Accep ...
- POJ 2528 Mayor's posters 【区间离散化+线段树区间更新&&查询变形】
任意门:http://poj.org/problem?id=2528 Mayor's posters Time Limit: 1000MS Memory Limit: 65536K Total S ...
- python 3+djanjo 2.0.7简单学习(五)--Django投票应用
1.编写一个简单的表单 编写的投票详细页面的模板 ("votes/detail.html") ,让它包含一个 HTML <form> 元素: <!DOCTYPE ...
- 【luogu P3275 [SCOI2011]糖果】 题解
题目链接:https://www.luogu.org/problemnew/show/P3275 把不等式 A > B 转化成 A - B >= 1或者 B - A <= -1再差分 ...
- 【luogu P3377 左偏树(可并堆)】 模板
题目连接:https://www.luogu.org/problemnew/show/P3377 #include <cstdio> #include <cstring> #i ...
- 【luogu P3376 网络最大流】 模板
题目链接:https://www.luogu.org/problemnew/show/P3376 #include <iostream> #include <cstdio> # ...
- 【luogu P1195 口袋的天空】 题解
题目链接:https://www.luogu.org/problemnew/show/P1195 嗯~我是被题目背景吸引到才做的,想吃棉花糖啦! 话说回来,这道题其实很容易就能想明白,k棵最小生成树. ...
- JDBC Like 参数化查询
构造SQL 语句: String sql = "select id,name,age,gender,birth from student where name like ?"; 参 ...
- php如何实现登陆后返回原页面
访问网站页面时,有的页面需要授权才能访问,这时候就会要求用户登录,跳转到登录页面login.php,怎么实现登录后返回到刚才访问的页面项目需求 访问网站页面时,有的页面需要授权才能访问,这时候就会要求 ...
- Angularjs实例应用
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content=&q ...