123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- #include "EvaluateView.h"
- #include "ProjectListWidget.h"
- #include "RenameWidget.h"
- #include "EvaluateOptionWidget.h"
- #include "common/QFDIcon.h"
- #include "SchemeWidget.h"
- #include <Widgets/Button.h>
- #include <Widgets/LineEdit.h>
- #include <QBoxLayout>
- #include <QLabel>
- #include <QTableWidget>
- #include <QDebug>
- EvaluateView::EvaluateView(QWidget *parent) : QWidget(parent) { }
- void EvaluateView::showEvent(QShowEvent *event)
- {
- qDebug() << __FUNCTION__ << __LINE__;
- if (m_initilized == false) {
- initialize();
- initLayout();
- connectSigalsAndSlots();
- m_initilized = true;
- }
- QWidget::showEvent(event);
- }
- void EvaluateView::hideEvent(QHideEvent *event)
- {
- QWidget::hideEvent(event);
- }
- void EvaluateView::initialize()
- {
- m_hBoxLayout = new QHBoxLayout(this);
- m_listWidget = new QWidget(this);
- m_listWidget->setFixedWidth(260);
- QPalette pal(m_listWidget->palette());
- pal.setColor(QPalette::Background, QColor("#f3f3f3"));
- m_listWidget->setAutoFillBackground(true);
- m_listWidget->setPalette(pal);
- m_listLayout = new QVBoxLayout(m_listWidget);
- m_searchLineEdit = new LineEdit(this);
- m_searchLineEdit->setIsClearButtonEnabled(true);
- m_searchLineEdit->setPlaceholderText("搜索工程");
- m_projListWidget = new ProjectListWidget(this);
- m_projDetailWidget = new QWidget(this);
- m_dataLayout = new QVBoxLayout(m_projDetailWidget);
- m_projNameLabel = new QLabel(this);
- m_projNameLabel->setObjectName("projNameLabel");
- m_projNameLabel->setText("工程1-技术方案评估");
- m_strategyLayout = new QHBoxLayout();
- m_strategyLayout->setAlignment(Qt::AlignLeft);
- m_resultButton = new RadioButton("结果集结群策", this);
- m_resultButton->setChecked(true);
- m_matrixButton = new RadioButton("矩阵集结群策", this);
- m_schemeButton = new PushButton("评估方案", NEWFLICON(QFDIcon, Schecme), this);
- m_tabWidget = new QTabWidget(this);
- m_tabWidget->setTabPosition(QTabWidget::South);
- m_tabWidget->addTab(new QTableWidget(this), "覆盖能力");
- m_tabWidget->addTab(new QTableWidget(this), "传输能力");
- m_tabWidget->addTab(new QTableWidget(this), "组网能力");
- m_pageLayout = new QHBoxLayout();
- m_pageLayout->setAlignment(Qt::AlignHCenter);
- m_pageLabel = new QLabel("第1/2页", this);
- m_lastPageButton = new PushButton("上一级指标", this);
- m_nextPageButton = new PushButton("下一级指标", this);
- m_separator = new QWidget();
- m_separator->setFixedWidth(1);
- m_separator->setStyleSheet("background-color:#dddddd");
- m_optionWidget = new EvaluateOptionWidget(this);
- m_optionWidget->setFixedWidth(200);
- m_schemeWidget = new SchemeWidget(this);
- }
- void EvaluateView::initLayout()
- {
- m_hBoxLayout->setMargin(0);
- m_hBoxLayout->addWidget(m_listWidget);
- m_listLayout->addWidget(m_searchLineEdit);
- m_listLayout->addWidget(m_projListWidget);
- m_hBoxLayout->addWidget(m_projDetailWidget);
- m_dataLayout->addWidget(m_projNameLabel);
- m_dataLayout->addSpacing(20);
- m_dataLayout->addLayout(m_strategyLayout);
- m_strategyLayout->addWidget(m_resultButton);
- m_strategyLayout->addSpacing(20);
- m_strategyLayout->addWidget(m_matrixButton);
- m_strategyLayout->addStretch();
- m_strategyLayout->addWidget(m_schemeButton);
- m_dataLayout->addWidget(m_tabWidget);
- m_dataLayout->addLayout(m_pageLayout);
- m_pageLayout->addWidget(m_lastPageButton);
- m_pageLayout->addWidget(m_pageLabel);
- m_pageLayout->addWidget(m_nextPageButton);
- m_hBoxLayout->addWidget(m_separator, Qt::AlignRight);
- m_hBoxLayout->addWidget(m_optionWidget, Qt::AlignRight);
- setStyleSheet("#projNameLabel {font-size:20px;font:bold;color:#333333}"
- "QTableWidget {border: 1px solid rgba(0, 0, 0, 0.073);background: rgb(244, 244, "
- "255);alternate-background-color: rgb(255, 255, 255);}"
- "QHeaderView::section {"
- "background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,"
- "stop:0 #616161, stop: 0.5 #505050,"
- "stop: 0.6 #434343, stop:1 #656565);"
- "color: white;"
- "padding-left: 4px;"
- "border: 1px solid #6c6c6c;"
- "}");
- const QString &s = m_schemeButton->styleSheet() + "PushButton {background-color:#92cde1; }";
- m_schemeButton->setStyleSheet(s);
- }
- void EvaluateView::connectSigalsAndSlots()
- {
- connect(m_schemeButton, &PushButton::clicked, this, &EvaluateView::slotSchemeClicked);
- }
- void EvaluateView::slotSchemeClicked()
- {
- if (m_schemeWidget->isVisible() == false) {
- m_schemeWidget->show();
- }
- }
|