ProgrammPage.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #include "ProgrammPage.h"
  2. ProgrammPage::ProgrammPage(QWidget *parent)
  3. : QWidget(parent)
  4. {
  5. ui.setupUi(this);
  6. // 连接选项卡切换信号
  7. connect(ui.tabWidget, &QTabWidget::currentChanged, this, &ProgrammPage::onTabChanged);
  8. initPage();
  9. }
  10. ProgrammPage::~ProgrammPage()
  11. {
  12. }
  13. void ProgrammPage::initPage()
  14. {
  15. this->setAttribute(Qt::WA_DeleteOnClose);
  16. onTabChanged(0);
  17. //m_BondMatrixProgramPage = new BondMatrixProgramPage(this);
  18. //m_pWaffleProgrammPage = new WaffleProgramPage(this);
  19. //m_WaferProgramPage = new WaferProgramPage(this);
  20. //ui.verticalLayoutBondMatrix->addWidget(m_BondMatrixProgramPage);
  21. //ui.verticalLayoutWaffleMatrix->addWidget(m_pWaffleProgrammPage);
  22. //ui.verticalLayoutWaferMatrix->addWidget(m_WaferProgramPage);
  23. }
  24. void ProgrammPage::onTabChanged(int index)
  25. {
  26. switch (index)
  27. {
  28. case 0: // Bond Matrix 页面
  29. if (!m_BondMatrixProgramPage)
  30. {
  31. qDebug() << "创建 BondMatrixProgramPage";
  32. m_BondMatrixProgramPage = new BondMatrixProgramPage(this);
  33. ui.verticalLayoutBondMatrix->addWidget(m_BondMatrixProgramPage);
  34. }
  35. break;
  36. case 1: // Wafer 页面
  37. if (!m_WaferProgramPage)
  38. {
  39. qDebug() << "创建 WaferProgramPage";
  40. m_WaferProgramPage = new WaferProgramPage(this);
  41. ui.verticalLayoutWaferMatrix->addWidget(m_WaferProgramPage);
  42. }
  43. break;
  44. case 2: // Waffle 页面
  45. if (!m_pWaffleProgrammPage)
  46. {
  47. qDebug() << "创建 WaffleProgramPage";
  48. m_pWaffleProgrammPage = new WaffleProgramPage(this);
  49. ui.verticalLayoutWaffleMatrix->addWidget(m_pWaffleProgrammPage);
  50. }
  51. break;
  52. }
  53. }