首页 > 技术文章 > 容器窗口 <QTabWidget>

weiyouqing 2017-09-19 22:26 原文

 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 }


 

推荐阅读