12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #include "EvalWidget.h"
- #include "dbService/ClassSet.h"
- #include <Widgets/Button.h>
- #include <QLabel>
- #include <QLayout>
- #include <QTabWidget>
- #include <QDebug>
- EvalWidget::EvalWidget(ProjectInfo *proj, QWidget *parent) : QWidget(parent), m_proj(proj)
- {
- initWidgets();
- initLayout();
- }
- ProjectInfo *EvalWidget::proj() const
- {
- return m_proj;
- }
- void EvalWidget::setProject(ProjectInfo *proj)
- {
- m_proj = proj;
- }
- int EvalWidget::type() const
- {
- return m_type;
- }
- void EvalWidget::setType(int type)
- {
- m_type = type;
- }
- QList<ProjectManager::IndexType> EvalWidget::indexList() const
- {
- ProjectManager::EvalTypes t = (ProjectManager::EvalTypes)m_type;
- return ProjectManager::indexListOfEvalTypes(t);
- }
- void EvalWidget::setTitle(const QString title)
- {
- m_title->setText(title);
- }
- void EvalWidget::initWidgets()
- {
- m_title = new QLabel(this);
- QFont ft("Microsoft YaHei", 12);
- m_title->setFont(ft);
- // 分割线
- m_seperator = new QWidget(this);
- m_seperator->setFixedHeight(1);
- QPalette pal(m_seperator->palette());
- pal.setColor(QPalette::Background, QColor("#aaaaaa"));
- m_seperator->setAutoFillBackground(true);
- m_seperator->setPalette(pal);
- m_tab = new QTabWidget(this);
- m_tab->setTabShape(QTabWidget::Rounded);
- }
- void EvalWidget::initLayout()
- {
- m_layout = new QVBoxLayout(this);
- m_topLayout = new QHBoxLayout(this);
- m_layout->addLayout(m_topLayout);
- m_layout->addWidget(m_seperator);
- m_contentLayout = new QHBoxLayout();
- m_layout->addLayout(m_contentLayout);
- m_topLayout->addWidget(m_title);
- m_contentLayout->addWidget(m_tab);
- }
|