1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #include "EXEvalView.h"
- #include "dbService/ClassSet.h"
- #include <Widgets/Button.h>
- #include <QLabel>
- #include <QLayout>
- #include <QTabWidget>
- #include <QDebug>
- EXEvalView::EXEvalView(ProjectInfo *proj, QWidget *parent) : QWidget(parent), m_proj(proj)
- {
- initWidgets();
- initLayout();
- }
- ProjectInfo *EXEvalView::proj() const
- {
- return m_proj;
- }
- void EXEvalView::setProject(ProjectInfo *proj)
- {
- m_proj = proj;
- }
- int EXEvalView::type() const
- {
- return m_type;
- }
- void EXEvalView::setType(int type)
- {
- m_type = type;
- }
- QList<ProjectManager::IndexType> EXEvalView::indexList() const
- {
- ProjectManager::EvalTypes t = (ProjectManager::EvalTypes)m_type;
- return ProjectManager::indexListOfEvalTypes(t);
- }
- void EXEvalView::setTitle(const QString title)
- {
- m_title->setText(title);
- }
- void EXEvalView::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);
- m_tab->setStyleSheet("QTabWidget#tabWidget{background-color:rgb(255,0,0);}\
- QTabBar::tab{background-color:rgb(211,211,211);color:rgb(0,0,0);}\
- QTabBar::tab::selected{background-color:rgb(155,155,155);color:rgb(255,255,255);}");
- }
- void EXEvalView::initLayout()
- {
- m_layout = new QVBoxLayout(this);
- m_topLayout = new QHBoxLayout();
- 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);
- }
|