12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #include "SchemePlanWidget.h"
- #include "SchemeFlowWidget.h"
- #include <CSchemeView.h>
- #include <Widgets/Button.h>
- #include <QTabWidget>
- #include <QLayout>
- #include <QDebug>
- 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<SchemePlanManager::SchemeProcessInfo> 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;
- }
|