#include "SchemePlanWidget.h" #include "SchemeFlowWidget.h" #include #include #include #include #include SchemePlanWidget::SchemePlanWidget(ProjectInfo *proj, QWidget *parent) : EvalWidget(proj, parent) { setTitle("评估方案规划"); setupUI(); } void SchemePlanWidget::setType(int type) { EvalWidget::setType(type); setupTabWidget(); } void SchemePlanWidget::setupUI() { m_topLayout->addStretch(); m_export = new PushButton("保存", this); m_export->setEnabled(false); m_topLayout->addWidget(m_export); m_topLayout->addSpacing(10); connect(m_export, &PushButton::clicked, this, &SchemePlanWidget::slotExportClicked); } void SchemePlanWidget::setupTabWidget() { m_tab->clear(); for (int i : indexList()) { SchemeFlowWidget *m = new SchemeFlowWidget(proj(), this); connect(m, &SchemeFlowWidget::sigSchemeProcessCreated, this, &SchemePlanWidget::slotSchemeCreated); connect(m, &SchemeFlowWidget::sigSchemeProcessEdited, this, &SchemePlanWidget::slotSchemeProcessEdited); m->setType(i); ProjectManager::IndexType t = (ProjectManager::IndexType)i; QString s = ProjectManager::nameOfIndexType(t); m_tab->addTab(m, s); } } void SchemePlanWidget::slotExportClicked() { for (int i = 0; i < m_tab->count(); i++) { SchemeFlowWidget *w = (SchemeFlowWidget *)m_tab->widget(i); QList schemes = w->schemes(); } } void SchemePlanWidget::slotSchemeCreated() { SchemeFlowWidget *w = (SchemeFlowWidget *)sender(); qDebug() << __FUNCTION__ << __LINE__ << w->indexType() << endl; } void SchemePlanWidget::slotSchemeProcessEdited(const SchemePlanManager::SchemeProcessInfo &process) { qDebug() << __FUNCTION__ << __LINE__ << process.id << endl; }