我有两个部件:Qt的C++访问属性
class Widget: public QWidget
{
public:
Button* button;
Widget();
int value; // need to get this var
}
Widget::Widget()
{
button = new Button(this);
}
class Button: public QPushButton
{
public:
Button(QWidget* parent = 0);
}
Button::Button(QWidget* parent) : QPushButton(parent)
{
this->parentWidget()->value // dont see var
}
如何,我可以看到从父窗口小部件属性?什么是最好的方法来做到这一点?由于
你的意思是什么可以看到?在你的编辑器(智能感知) - 在屏幕上? – mbx
抱歉不准确。我的意思是可以访问变量 – Outsider