容器窗口 <QTabWidget>
1 //////////////////////////////////////////
#include "test9_2a.h" 2 #include "M_win.h" 3 4 Test9_2A::Test9_2A(QWidget *parent) 5 : QMainWindow(parent) 6 { 7 8 ui.setupUi(this); 9 10 M_win *page = new M_win(); 11 12 ui.stackedWidget->insertWidget(0,page); 13 14 connect(ui.BtnFirst, SIGNAL(clicked()), this, SLOT(OnBtnFirst())); 15 connect(ui.BtnSecond, SIGNAL(clicked()), this, SLOT(OnBtnSecond())); 16 connect(ui.BtnThird, SIGNAL(clicked()), this, SLOT(OnBtnthird())); 17 18 } 19 20 Test9_2A::~Test9_2A() 21 { 22 23 } 24 25 int Test9_2A::OnBtnFirst() 26 { 27 ui.stackedWidget->setCurrentIndex(0); 28 return 0; 29 } 30 31 int Test9_2A::OnBtnSecond() 32 { 33 ui.stackedWidget->setCurrentIndex(1); 34 return 0; 35 } 36 37 int Test9_2A::OnBtnthird() 38 { 39 ui.stackedWidget->setCurrentIndex(2); 40 return 0; 41 }
青青园中葵,朝露待日晞。
阳春布德泽,万物生光辉。
常恐秋节至,焜黄华叶衰。
百川东到海,何时复西归?
少壮不努力,老大徒伤悲!