#include "EvalWidget.h" #include #include #include EvalWidget::EvalWidget(ProjectInfo *proj, int type, QWidget *parent) : QWidget(parent), m_proj(proj), m_type(type) { 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; } 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); } void EvalWidget::initLayout() { m_layout = new QVBoxLayout(this); m_contentLayout = new QVBoxLayout(); m_layout->addWidget(m_title); m_layout->addWidget(m_seperator); m_layout->addLayout(m_contentLayout); }