DataProcessingWidget.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "DataProcessingWidget.h"
  2. #include "EvalReportWidget.h"
  3. #include <Widgets/Button.h>
  4. #include <QTabWidget>
  5. #include <QBoxLayout>
  6. DataProcessingWidget::DataProcessingWidget(ProjectInfo *proj, QWidget *parent) : EvalWidget(proj, parent)
  7. {
  8. setTitle("评估数据处理");
  9. m_exportReport = new PushButton("导出报告", this);
  10. m_topLayout->addStretch();
  11. m_topLayout->addWidget(m_exportReport);
  12. connect(m_exportReport, &PushButton::clicked, this, &DataProcessingWidget::slotExportReport);
  13. }
  14. void DataProcessingWidget::setType(int type)
  15. {
  16. EvalWidget::setType(type);
  17. setupTabWidget();
  18. }
  19. void DataProcessingWidget::slotExportReport()
  20. {
  21. EvalReportWidget *w = (EvalReportWidget *)m_tab->currentWidget();
  22. w->exportReport();
  23. }
  24. void DataProcessingWidget::setupTabWidget()
  25. {
  26. m_tab->clear();
  27. for (int i : indexList()) {
  28. EvalReportWidget *m = new EvalReportWidget(m_proj, i, this);
  29. ProjectManager::IndexType t = (ProjectManager::IndexType)i;
  30. QString s = ProjectManager::nameOfIndexType(t);
  31. m_tab->addTab(m, s);
  32. }
  33. }