|
@@ -3,6 +3,10 @@
|
|
|
#include "ProjectListWidget.h"
|
|
|
#include "RenameWidget.h"
|
|
|
#include "ConfigExpertWidget.h"
|
|
|
+#include "IndexSystemWidget.h"
|
|
|
+#include "EvalSchemeWidget.h"
|
|
|
+#include "DataCollectionWidget.h"
|
|
|
+#include "DataProcessingWidget.h"
|
|
|
|
|
|
#include "common/ProjectManager.h"
|
|
|
|
|
@@ -14,6 +18,7 @@
|
|
|
|
|
|
#include <QBoxLayout>
|
|
|
#include <QLabel>
|
|
|
+#include <QStackedWidget>
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
@@ -69,12 +74,23 @@ void ProjectView::initWidgets()
|
|
|
m_tree->setFixedWidth(200);
|
|
|
|
|
|
// 分割线
|
|
|
- m_contentSeperator = new QWidget(this);
|
|
|
- m_contentSeperator->setFixedWidth(1);
|
|
|
- QPalette pal(m_contentSeperator->palette());
|
|
|
+ m_seperator = new QWidget(this);
|
|
|
+ m_seperator->setFixedWidth(1);
|
|
|
+ QPalette pal(m_seperator->palette());
|
|
|
pal.setColor(QPalette::Background, QColor("#aaaaaa"));
|
|
|
- m_contentSeperator->setAutoFillBackground(true);
|
|
|
- m_contentSeperator->setPalette(pal);
|
|
|
+ m_seperator->setAutoFillBackground(true);
|
|
|
+ m_seperator->setPalette(pal);
|
|
|
+
|
|
|
+ m_stack = new QStackedWidget(this);
|
|
|
+ m_indexSystem = new IndexSystemWidget(m_stack, 1);
|
|
|
+ m_evalScheme = new EvalSchemeWidget(m_stack, 2);
|
|
|
+ m_dataCollection = new DataCollectionWidget(m_stack, 3);
|
|
|
+ m_dataProcessing = new DataProcessingWidget(m_stack, 4);
|
|
|
+
|
|
|
+ m_stack->addWidget(m_indexSystem);
|
|
|
+ m_stack->addWidget(m_evalScheme);
|
|
|
+ m_stack->addWidget(m_dataCollection);
|
|
|
+ m_stack->addWidget(m_dataProcessing);
|
|
|
}
|
|
|
|
|
|
void ProjectView::initLayout()
|
|
@@ -91,8 +107,8 @@ void ProjectView::initLayout()
|
|
|
m_headerLayout->addSpacing(10);
|
|
|
|
|
|
m_contentLayout->addWidget(m_tree);
|
|
|
- m_contentLayout->addWidget(m_contentSeperator);
|
|
|
- m_contentLayout->addStretch();
|
|
|
+ m_contentLayout->addWidget(m_seperator);
|
|
|
+ m_contentLayout->addWidget(m_stack);
|
|
|
}
|
|
|
|
|
|
void ProjectView::connectSigalsAndSlots()
|
|
@@ -112,8 +128,10 @@ void ProjectView::itemClicked(QTreeWidgetItem *item, int column)
|
|
|
taskIndex = item->parent()->indexOfChild(item);
|
|
|
}
|
|
|
|
|
|
+ // 点击一级条目时, 选中其首个子条目
|
|
|
if (taskIndex < 0) {
|
|
|
- item->child(0)->setSelected(true);
|
|
|
+ taskIndex = 0;
|
|
|
+ item->child(taskIndex)->setSelected(true);
|
|
|
}
|
|
|
|
|
|
ProjectManager::EvalType type = ProjectManager::evalTypeList(*m_proj)[typeIndex];
|
|
@@ -121,4 +139,6 @@ void ProjectView::itemClicked(QTreeWidgetItem *item, int column)
|
|
|
|
|
|
qDebug() << __FUNCTION__ << __LINE__ << typeIndex << taskIndex << m_proj->projectName << typeName
|
|
|
<< m_tree->selectedItems().first()->text(0) << endl;
|
|
|
+
|
|
|
+ m_stack->setCurrentIndex(taskIndex);
|
|
|
}
|