12345678910111213141516171819202122232425262728293031323334353637383940 |
- #include "DataProcessingWidget.h"
- #include "EvalReportWidget.h"
- #include <Widgets/Button.h>
- #include <QTabWidget>
- #include <QBoxLayout>
- DataProcessingWidget::DataProcessingWidget(ProjectInfo *proj, QWidget *parent) : EvalWidget(proj, parent)
- {
- setTitle("评估数据处理");
- m_exportReport = new PushButton("导出报告", this);
- m_topLayout->addStretch();
- m_topLayout->addWidget(m_exportReport);
- connect(m_exportReport, &PushButton::clicked, this, &DataProcessingWidget::slotExportReport);
- }
- void DataProcessingWidget::setType(int type)
- {
- EvalWidget::setType(type);
- setupTabWidget();
- }
- void DataProcessingWidget::slotExportReport()
- {
- EvalReportWidget *w = (EvalReportWidget *)m_tab->currentWidget();
- w->exportReport();
- }
- void DataProcessingWidget::setupTabWidget()
- {
- m_tab->clear();
- for (int i : indexList()) {
- EvalReportWidget *m = new EvalReportWidget(m_proj, i, this);
- ProjectManager::IndexType t = (ProjectManager::IndexType)i;
- QString s = ProjectManager::nameOfIndexType(t);
- m_tab->addTab(m, s);
- }
- }
|