#include "ConfigMeasureDataWidget.h" #include "ProjectManager.h" #include "dbService/SchemeInfoService.h" #include #include #include #include #include #include ConfigMeasureDataWidget::ConfigMeasureDataWidget(QWidget *parent) : QWidget(parent) { initWidget(); initLayout(); connectSignalsAndSlots(); } void ConfigMeasureDataWidget::setProcess(SchemePlanManager::SchemeProcessInfo process) { m_process = process; } void ConfigMeasureDataWidget::initWidget() { m_titleLabel = new QLabel("导入实测数据", this); m_titleLabel->setObjectName("titleLabel"); m_titleLabel->setFixedHeight(50); m_titleLabel->setContentsMargins(10, 0, 0, 0); m_listTitleLabel = new QLabel("数据列表", this); m_listTitleLabel->setObjectName("listTitleLabel"); m_tipsLabel = new QLabel("已导入的数据将会显示在这里", this); m_tipsLabel->setObjectName("tipsLabel"); m_tipsLabel->setHidden(true); m_addButton = new QPushButton(NEWFLICON(FluentIcon, ADD)->icon(), "", this); m_addButton->setToolTip("添加数据"); m_listWidget = new QListWidget(this); setStyleSheet("#titleLabel {color:#333333; font-size:16px}" "#listTitleLabel {color:#333333; font-size:12px}" "QPushButton {border: 0;background-color: qlineargradient(x1: 0, y1: 0, x2: " "0, y2: 1,stop: 0 #f8f8f8, stop: 1 #f8f8f8);}" "QPushButton::hover {border: 1px solid rgba(0, 0, 0, 0.073);}" "QPushButton::pressed {background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #dadbde, " "stop: 1 #f6f7fa);}" "QListWidget {border: 1px solid rgba(0, 0, 0, 0.073);}" "QListView::item {height:44;}"); } void ConfigMeasureDataWidget::initLayout() { m_layout = new QVBoxLayout(this); m_layout->setMargin(0); m_layout->setSpacing(0); m_layout->addWidget(m_titleLabel); m_headerLayout = new QHBoxLayout(); m_layout->addLayout(m_headerLayout); m_layout->addSpacing(10); m_layout->addWidget(m_tipsLabel); m_layout->addWidget(m_listWidget); m_headerLayout->addWidget(m_listTitleLabel); m_headerLayout->addStretch(); m_headerLayout->addWidget(m_addButton); } void ConfigMeasureDataWidget::connectSignalsAndSlots() { connect(m_addButton, &PushButton::clicked, this, &ConfigMeasureDataWidget::slotAddDataClicked); } void ConfigMeasureDataWidget::slotAddDataClicked() { emit sigAddData(); }