QWidget* p=QPushButton::find( ui->Btn_0->winId()); /* 这个将QPushButton转换到基类QWidget了,丧失了QPushButton的独有方法 ,只含有基类QWidget的成员,ui->Btn_0->winId())返回的是Button Btn_0的句柄*/
/*centralWidget获取的是UI的中央控件,所有这些按钮等空间都布局在centralWidget中央控件上 相当于这些控件的父类*/
QPushButton *da=QMainWindow::centralWidget()->findChild<QPushButton*>("Btn_1"); 这样就可以在ui设计器上找到名字为Btn_1的QPushButton了
等价于下面这个式子: