C++ 中的值访问
嗨,
我有两个 A 类和 B 类, 这里 A 继承了 B,现在我想从 A 访问 B 中的变量,我在 B 中包含了 A 标头并尝试访问,但在 QObject 中显示一些错误。
是否可以这样访问..请帮忙
HI,
I have two clases A and B,
Here A is inheriting B and now i want to access a variable in B from A, I included A header in B and tried to access but showing some error in QObject.
Is it possible to acces like this.. Please help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不确定我是否正确理解了你的问题......
可能的解决方案:
Not sure i get your Q correctly....
Possible solution:
你的成员变量是
私有
吗?那么你就不能声明它受保护
。Is your member variable
private
? Then you cannot, declare itprotected
.