diff --git a/CMakeLists.txt b/CMakeLists.txt index cde4a35..2bf2a52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ set(H_HEADER_FILES include/createEditor.h include/monitorItemsDlg.h include/monitorPagesDlg.h + include/baseDockWidget.h common/include/global.h common/include/tools.h @@ -86,6 +87,7 @@ set(CPP_SOURCE_FILES source/createEditor.cpp source/monitorItemsDlg.cpp source/monitorPagesDlg.cpp + source/baseDockWidget.cpp common/source/httpInterface.cpp common/source/global.cpp diff --git a/common/include/global.h b/common/include/global.h index ec013f9..788d0dc 100644 --- a/common/include/global.h +++ b/common/include/global.h @@ -1020,6 +1020,7 @@ struct monitorPageInfo //运行时page struct gridInfo { int id = -1; + QString tagname; QString name; QString description; }; @@ -1028,6 +1029,7 @@ struct zoneInfo { int id = -1; int grid_id = -1; + QString tagname; QString name; QString description; }; @@ -1036,6 +1038,7 @@ struct stationInfo { int id = -1; int zone_id = -1; + QString tagname; QString name; QString description; bool is_local = true; @@ -1195,7 +1198,7 @@ struct monitorItemAttributeInfo //单个监控item属性 bool bShowDiagram = false; //显示到组态中 int nGraphType = 0; //图表类型 0折线1柱状 QString sTimeRange; //时间范围(分) - QString sValue; //属性值 + QMap mapValue; //属性值 bool bSelected = false; // 转换为JSON对象 @@ -1210,7 +1213,7 @@ struct monitorItemAttributeInfo //单个监控item属性 obj["bShowDiagram"] = bShowDiagram; obj["nGraphType"] = nGraphType; obj["sTimeRange"] = sTimeRange; - obj["sValue"] = sValue; + obj["sValue"] = mapToJson(mapValue); obj["bSelected"] = bSelected; return obj; } @@ -1226,7 +1229,7 @@ struct monitorItemAttributeInfo //单个监控item属性 bShowDiagram = json["bShowDiagram"].toBool(); nGraphType = json["nGraphType"].toInt(); sTimeRange = json["sTimeRange"].toString(); - sValue = json["sValue"].toString(); + mapValue = jsonToMap(json["sValue"].toObject()); bSelected = json["bSelected"].toBool(); } @@ -1241,6 +1244,34 @@ struct monitorItemAttributeInfo //单个监控item属性 sName == other.sName && sGroup == other.sGroup; } + + QJsonObject mapToJson(const QMap& map) const{ + QJsonObject jsonObj; + + for (auto it = map.constBegin(); it != map.constEnd(); ++it) { + // 将quint64的key转换为QString + QString key = QString::number(it.key()); + jsonObj[key] = it.value(); + } + + return jsonObj; + } + + // 从JSON转换回来 + QMap jsonToMap(const QJsonObject& jsonObj) const{ + QMap map; + + for (auto it = jsonObj.constBegin(); it != jsonObj.constEnd(); ++it) { + bool ok; + quint64 key = it.key().toULongLong(&ok); + if (ok) { + double value = it.value().toDouble(); + map[key] = value; + } + } + + return map; + } }; enum class monitorItemState{ //监控item的状态 diff --git a/common/source/baseProperty.cpp b/common/source/baseProperty.cpp index cc5315e..1480ece 100644 --- a/common/source/baseProperty.cpp +++ b/common/source/baseProperty.cpp @@ -70,10 +70,6 @@ BaseProperty::BaseProperty(QObject* parent) bInService = true; nState = 1; nStatus = 1; - - sGrid=QString("1"); //暂时修改,数据库字段不为空 - sZone=QString("1"); - sStation=QString("1"); } BaseProperty::~BaseProperty() diff --git a/diagramCavas/include/drawingPanel.h b/diagramCavas/include/drawingPanel.h index f216cf2..1b4108d 100644 --- a/diagramCavas/include/drawingPanel.h +++ b/diagramCavas/include/drawingPanel.h @@ -15,9 +15,9 @@ public: DrawingPanel(PowerEntity* pEntity,QWidget *parent = nullptr,DiagramMode mode = DM_edit); ~DrawingPanel(); - QJsonObject getDiagramInfo() const; //返回图元位置信息 - void loadNodes(QJsonObject obj) override; //加载图元信息 - void saveNodes(int pageId) override; //保存到数据库 + virtual QJsonObject getDiagramInfo() override; //返回图元位置信息 + virtual void loadNodes(QJsonObject obj) override; //加载图元信息 + virtual void saveNodes(int pageId) override; //保存到数据库 protected: void closeEvent(QCloseEvent *closeEvent) override; public slots: diff --git a/diagramCavas/include/graphicsDataModel/fixedPortsModel.h b/diagramCavas/include/graphicsDataModel/fixedPortsModel.h index ba957df..04a85f5 100644 --- a/diagramCavas/include/graphicsDataModel/fixedPortsModel.h +++ b/diagramCavas/include/graphicsDataModel/fixedPortsModel.h @@ -82,7 +82,7 @@ public: void showProjectModelSettingDlg(GraphicsBaseModelItem*); //在基模拓扑图上打开工程模设置对话框 void generateProjectModel(const QString&,QList,QList); //由基模生成工程模 - void addProjectItemByBaseData(DrawingPanel*,GraphicsBaseModelItem*,BaseProperty*); //从基模item生成工程模item + void addProjectItemByBaseData(DrawingPanel*,GraphicsBaseModelItem*,BaseProperty*,QString sGrid = "",QString sZone = "",QString sStation = ""); //从基模item生成工程模item void onWizardFinished(QMap mapItem,QList mapBay); //editor结束生成基模 /*************************间隔*****************************/ void addBayItem(QUuid,ModelFunctionType = ModelFunctionType::ProjectModel); @@ -115,6 +115,7 @@ public: void startAcceptData(); //开始接收实时数据 void stopAcceptData(QString); //停止接收实时数据 + QMap>>& getMonitorStateMap(){return m_monitorStateMap;} void setMonitorDisplaySetting(QMap> map){m_monitorDisplaySetting = map;} QMap>& getMonitorDisplaySetting(){return m_monitorDisplaySetting;} @@ -128,6 +129,7 @@ Q_SIGNALS: void itemSelected(QList); //发送选中的元件 void monitorCreated(QString,QPair); //监控创建信号 <工程page,<监控page,page_uid>> void monitorItems(QList); //发送创建成功的Items + void dataUpdated(); //数据更新通知 public: void setPageName(QString s) {_pageName = s;} //设置表名称 QString pageName() const {return _pageName;} @@ -152,6 +154,7 @@ private: void autoSetModelName(GraphicsBaseModelItem*); //如果此页的工程模已被设置,将projectName更新到item QString removeSuffix(const QString& str); //移除最后一个下划线后的内容 (处理各种tag后缀) ModelProperty* getItemByUid(QList,QUuid); //返回uid对应的data + void updateMonitor(QMap>); //使用当前数据更新运行时 private: QMap _nodeItem; //工程模对象 diff --git a/diagramCavas/include/graphicsItem/handleText.h b/diagramCavas/include/graphicsItem/handleText.h index cca8f53..e7fcf06 100644 --- a/diagramCavas/include/graphicsItem/handleText.h +++ b/diagramCavas/include/graphicsItem/handleText.h @@ -4,7 +4,7 @@ #include #include "graphicsItem/itemControlHandle.h" -int const TEXT_WIDTH = 80; +int const TEXT_WIDTH = 100; int const TEXT_HEIGHT = 40; class QGraphicsProxyWidget; diff --git a/diagramCavas/include/monitorAttributeGroupDlg.h b/diagramCavas/include/monitorAttributeGroupDlg.h index 1d04edf..559ad7b 100644 --- a/diagramCavas/include/monitorAttributeGroupDlg.h +++ b/diagramCavas/include/monitorAttributeGroupDlg.h @@ -20,14 +20,15 @@ public: ~MonitorAttributeGroupDlg(); void initial(); - void createGroupView(QList); + void createGroupView(QList,int nType = 0); //0小型 1中型 void setParent(MonitorAttributeDlg* p) {_pParent = p;} void setDetailParent(MonitorDetailAttributeDlg* p){_pDetailParent = p;} void setCurMode(int n) {_curMode = n;} -private: - QWidget* createEditor(monitorItemAttributeInfo); - void updateLineChartData(QChartView* chartView, const QVector& data); +public slots: void updateData(); //使用数据更新当前界面 +private: + QWidget* createEditor(monitorItemAttributeInfo,int nType = 0); //nType:0小 1中 + void updateLineChartData(QChartView* chartView, const QVector& data); FixedPortsModel* getModelController(); QUuid getCurUid(); private: diff --git a/diagramCavas/source/ctExtraInfoDlg.cpp b/diagramCavas/source/ctExtraInfoDlg.cpp index 713b3fb..4657435 100644 --- a/diagramCavas/source/ctExtraInfoDlg.cpp +++ b/diagramCavas/source/ctExtraInfoDlg.cpp @@ -125,7 +125,9 @@ void CtExtraInfoDlg::setPropertyValue(QVariant var) } else if(info.name == "仪表保安系数" || info.name == "fs") { - ui->le_isf->setText(info.defaultValue.toString()); + if(info.defaultValue.toString() == "null") + ui->le_isf->setText(0); + ui->le_isf->setText(QString::number(info.defaultValue.toDouble())); } else if(info.name == "热稳定电流(A)" || info.name == "ith_a") { diff --git a/diagramCavas/source/diagramCavas.cpp b/diagramCavas/source/diagramCavas.cpp index b4fe609..e3e27fa 100644 --- a/diagramCavas/source/diagramCavas.cpp +++ b/diagramCavas/source/diagramCavas.cpp @@ -270,10 +270,12 @@ void DiagramCavas::onSignal_savePage() } } + auto context = pPanel->getDiagramInfo(); + if(DataBase::GetInstance()->getPageIdByName(_curPage) == -1) //不存在,创建 - DataBase::GetInstance()->insertPage(_curPage,_curPage,QJsonObject(),pPanel->getDiagramInfo(),QString("page"),1); + DataBase::GetInstance()->insertPage(_curPage,_curPage,QJsonObject(),context,QString("page"),1); else - DataBase::GetInstance()->updatePage(_curPage,_curPage,pPanel->getDiagramInfo()); + DataBase::GetInstance()->updatePage(_curPage,_curPage,context); int pageId = DataBase::GetInstance()->getPageIdByName(_curPage); pPanel->saveNodes(pageId); diff --git a/diagramCavas/source/diagramConnectSetting.cpp b/diagramCavas/source/diagramConnectSetting.cpp index 7dc2f01..953fbd0 100644 --- a/diagramCavas/source/diagramConnectSetting.cpp +++ b/diagramCavas/source/diagramConnectSetting.cpp @@ -21,6 +21,7 @@ DiagramConnectSetting::~DiagramConnectSetting() void DiagramConnectSetting::initial() { connect(ui->btn_testRecommand,&QPushButton::clicked,this,&DiagramConnectSetting::onTestHttpRecommandClicked); + connect(ui->btn_testData,&QPushButton::clicked,this,&DiagramConnectSetting::onTestHttpDataClicked); connect(ui->btn_testData,&QPushButton::clicked,this,&DiagramConnectSetting::onTestWebsocketClicked); connect(ui->btn_testWebsoc,&QPushButton::clicked,this,&DiagramConnectSetting::onTestWebsocketClicked); connect(ui->btn_ok,&QPushButton::clicked,this,&DiagramConnectSetting::onOkClicked); @@ -61,6 +62,9 @@ void DiagramConnectSetting::updateHttpLog(QString sType,QString data) else if(sType == "subscriptions"){ ui->label_httpData->setText("联通"); } + else if(sType == "subscriptionTest"){ + ui->label_httpData->setText("联通"); + } } void DiagramConnectSetting::updateWebsocketLog(QString str) @@ -76,7 +80,9 @@ void DiagramConnectSetting::onTestHttpRecommandClicked() void DiagramConnectSetting::onTestHttpDataClicked() { + QString sPath = ui->le_httpIp->text()+"/monitors/data/subscriptions"; + UiCommunicationBus::instance()->sendHttpRequest(sPath,QVariant(),"POST"); } void DiagramConnectSetting::onTestWebsocketClicked() diff --git a/diagramCavas/source/drawingPanel.cpp b/diagramCavas/source/drawingPanel.cpp index d6b8778..3f1023a 100644 --- a/diagramCavas/source/drawingPanel.cpp +++ b/diagramCavas/source/drawingPanel.cpp @@ -103,7 +103,7 @@ void DrawingPanel::onSignal_Generate() m_pDiagramNameInputer->show(); } -QJsonObject DrawingPanel::getDiagramInfo() const +QJsonObject DrawingPanel::getDiagramInfo() { QJsonObject obj; QJsonArray arr; @@ -224,7 +224,7 @@ void DrawingPanel::loadNodes(QJsonObject obj) QList lstFirst; for(auto& pBaseItem:_pModel->getProjectItems()) //首次循环添加母线及独立设备(变压器等),更新列表显示使用 { - BaseModelProperty* pBase = dynamic_cast(pBaseItem->getProperty()); + BaseProperty* pBase = dynamic_cast(pBaseItem->getProperty()); if(pBase->type() == 1){ //母线添加子间隔 monitorRelationItem info; info.item.nEquipType = pBase->type(); @@ -292,7 +292,7 @@ void DrawingPanel::loadNodes(QJsonObject obj) QList lstSecond; for(auto& pBaseItem:_pModel->getProjectItems()) //二次循环添加间隔内设备(更新列表显示使用) { - BaseModelProperty* pBase = dynamic_cast(pBaseItem->getProperty()); + BaseProperty* pBase = dynamic_cast(pBaseItem->getProperty()); if(pBase->type() != 1 && pBase->type() != 15 && pBase->type() != 16){ //设备添加 monitorRelationItem info; info.item.nEquipType = pBase->type(); diff --git a/diagramCavas/source/graphicsDataModel/fixedPortsModel.cpp b/diagramCavas/source/graphicsDataModel/fixedPortsModel.cpp index f0b607e..e29c92a 100644 --- a/diagramCavas/source/graphicsDataModel/fixedPortsModel.cpp +++ b/diagramCavas/source/graphicsDataModel/fixedPortsModel.cpp @@ -49,6 +49,7 @@ #include "designerView.h" #include "uiCommunicationBus.h" #include "instance/dataAccessor.h" +#include "graphicsItem/handleText.h" #include "global.h" bool FixedPortsModel::_dataInitialised = false; @@ -68,6 +69,7 @@ FixedPortsModel::FixedPortsModel(PowerEntity* pEntity) loadNodeDataFromDataBase(); _Interface = new HttpInterface(this); _timer = new QTimer(this); + m_dataTimer = new QTimer(this); _modelStateInfo = DataManager::instance().modelState(); _modelDataInfo = DataManager::instance().modelData(); @@ -1213,6 +1215,8 @@ void FixedPortsModel::onDataTimerOut() auto pDataAccessor = _cavas->getDataAccessor(); if(pDataAccessor){ _curData = pDataAccessor->getTargetData(_curRequestLst); + if(!_curData.isEmpty()) + updateMonitor(_curData); } } } @@ -1285,6 +1289,31 @@ ModelProperty* FixedPortsModel::getItemByUid(QList lst,QUuid return nullptr; } +void FixedPortsModel::updateMonitor(QMap> data) +{ + for(auto iter = m_monitorPara.begin();iter != m_monitorPara.end();++iter){ + for(auto &info:iter.value()){ + //if(info.bSelected){ + if(data.contains(info.sConnectPara)){ + info.mapValue = data.value(info.sConnectPara); + } + //} + } + } + emit dataUpdated(); + + for(auto& item:_nodeItem){ //更新界面中的数据 + QMap mapText = item->getDynamicText(); + for(auto &pText:mapText){ + QString sPara = pText->getPara(); + if(data.contains(sPara)){ + QString sVal= QString::number(data.value(sPara).last()); + pText->setText(sVal); + pText->update(); + } + } + } +} QWidget* FixedPortsModel::getTopWidget() { @@ -1546,6 +1575,18 @@ void FixedPortsModel::generateProjectModel(const QString& sPageName,QListonSignal_createDiagram(info); pProPanel = _cavas->getPanel(sPageName); } + QList lstGrid = DataBase::GetInstance()->getAllGrid(); + QList lstZone = DataBase::GetInstance()->getAllZone(); + QList lstStation = DataBase::GetInstance()->getAllStation(); + QString sG; + QString sZ; + QString sS; + if(!lstGrid.isEmpty()) + sG = lstGrid.first().tagname; + if(!lstZone.isEmpty()) + sZ = lstZone.first().tagname; + if(!lstStation.isEmpty()) + sS = lstStation.first().tagname; for(auto& pBaseItem:lstItem) //先处理连线,递归处理连线连接的item { @@ -1557,7 +1598,10 @@ void FixedPortsModel::generateProjectModel(const QString& sPageName,QListsetDataChanged(true); //数据状态改变 - addProjectItemByBaseData(pProPanel,pBaseItem,pData); + pData->setGrid(sG); + pData->setZone(sZ); + pData->setStation(sS); + addProjectItemByBaseData(pProPanel,pBaseItem,pData,sG,sZ,sS); } } } @@ -1847,7 +1891,7 @@ void FixedPortsModel::onWizardFinished(QMap mapIte } } -void FixedPortsModel::addProjectItemByBaseData(DrawingPanel* pPanel,GraphicsBaseModelItem* pItem,BaseProperty* pPro) +void FixedPortsModel::addProjectItemByBaseData(DrawingPanel* pPanel,GraphicsBaseModelItem* pItem,BaseProperty* pPro,QString sGrid,QString sZone,QString sStation) { BaseModelProperty* pBase = dynamic_cast(pItem->getProperty()); if(pBase){ @@ -2202,8 +2246,10 @@ void FixedPortsModel::addProjectItemByBaseData(DrawingPanel* pPanel,GraphicsBase { QUuid id = QUuid(baseFromComponentId); GraphicsBaseModelItem* pFromItem = _baseItem.value(id); - //QUuid id = QUuid::createUuid(); BaseProperty* pData = pPanel->getModelController()->addNodeData(id,pFromItem->getProperty()->type(),pFromItem->getProperty()->name(),pFromItem->getProperty()->modelName()); + pData->setGrid(sGrid); + pData->setZone(sZone); + pData->setStation(sStation); addProjectItemByBaseData(pPanel,pFromItem,pData); proFromItemId = id.toString(); } @@ -2212,8 +2258,10 @@ void FixedPortsModel::addProjectItemByBaseData(DrawingPanel* pPanel,GraphicsBase { QUuid id = QUuid(baseToComponentId); GraphicsBaseModelItem* pToItem = _baseItem.value(id); - //QUuid id = QUuid::createUuid(); BaseProperty* pData = pPanel->getModelController()->addNodeData(id,pToItem->getProperty()->type(),pToItem->getProperty()->name(),pToItem->getProperty()->modelName()); + pData->setGrid(sGrid); + pData->setZone(sZone); + pData->setStation(sStation); addProjectItemByBaseData(pPanel,pToItem,pData); proToItemId = id.toString(); } diff --git a/diagramCavas/source/graphicsItem/graphicsBaseItem.cpp b/diagramCavas/source/graphicsItem/graphicsBaseItem.cpp index 655a377..7196b1d 100644 --- a/diagramCavas/source/graphicsItem/graphicsBaseItem.cpp +++ b/diagramCavas/source/graphicsItem/graphicsBaseItem.cpp @@ -241,6 +241,7 @@ void GraphicsBaseItem::addDynamicText(QString tag,QString para) pText->setIndex(ntagId); pText->setTagName(tag); pText->setType(1); + pText->setPara(para); m_vecHanle.insert(ntagId,pText); m_mapDynamicText.insert(tag,pText); diff --git a/diagramCavas/source/instance/dataAccessor.cpp b/diagramCavas/source/instance/dataAccessor.cpp index d878e62..a267f8b 100644 --- a/diagramCavas/source/instance/dataAccessor.cpp +++ b/diagramCavas/source/instance/dataAccessor.cpp @@ -9,6 +9,8 @@ #include #include "global.h" +const int DIAGRAM_MAX_DATA_COUNT = 1000; + DataAccessor::DataAccessor(QObject* parent) : QObject(parent) ,_parentCavas(nullptr) @@ -29,12 +31,13 @@ void DataAccessor::onReceiveHttpData(const QString& sType,const QVariant& data) QString sClientId = dataObj.value("client_id").toString(); QMap lstTarget; - QJsonArray measureArr = dataObj.value("measurements").toArray(); - for(const QJsonValue& value : measureArr){ + QJsonArray targetArr = dataObj.value("targets").toArray(); + for(const QJsonValue& value : targetArr){ QJsonObject obj = value.toObject(); QString sId = obj["id"].toString(); QString sCode = obj["code"].toString(); + qDebug() << "subscription:"+sId+"_"+sCode; if(!lstTarget.contains(sId)){ lstTarget.insert(sId,sCode); } @@ -75,14 +78,11 @@ void DataAccessor::onReceiveHttpData(const QString& sType,const QVariant& data) // 比较两个列表是否相同 if (sortedFirstElements == sortedLstKeys) { - // 这里需要一个 id 参数,你可以从 lstRequest 中获取或使用其他方式 - QString id; // 你需要确定 id 从哪里来 - // 调用 moveMatchingRequests for(auto& pair:tempList){ pair.second = "connecting"; } - UiCommunicationBus::instance()->insertSesstionMap(id, lstTarget); + UiCommunicationBus::instance()->insertSesstionMap(sClientId, lstTarget); sAction = "start"; break; } @@ -95,7 +95,8 @@ void DataAccessor::onReceiveHttpData(const QString& sType,const QVariant& data) QString sPre = removeAfterStreamBySplit(config.endpoint); //手动移除 config.endpoint = sPre + "/" + sClientId; CommunicationManager::instance()->updateWebSocketConfig(config,sClientId); - CommunicationManager::instance()->connectWebSocket(sClientId); + bool res = CommunicationManager::instance()->connectWebSocket(sClientId); + int a = 1; } else if(sAction == "stop"){ //已经停止完毕,从session中移除会话 auto &map = UiCommunicationBus::instance()->getSesstionMap(); @@ -130,6 +131,9 @@ void DataAccessor::onReceiveHttpData(const QString& sType,const QVariant& data) } } } + else if(sType == "subscriptionTest"){ + qDebug()<<"receive null data"; + } if(_parentCavas){ auto pDlg = _parentCavas->getConnectSettingDlg(); if(pDlg){ @@ -163,12 +167,19 @@ void DataAccessor::onReceiveWebsocketData(const QVariant& data) } } - QMutexLocker locker(&m_mutex); - if (_realTimeData.contains(targetId)) { - _realTimeData[targetId].insert(newInnerMap); - - } else { - _realTimeData.insert(targetId, newInnerMap); + QMutexLocker locker(&m_mutex); + auto& innerMap = _realTimeData[targetId]; // 自动创建或获取 + // 批量插入 + innerMap.insert(newInnerMap); + // 如果数量超限,从开始处批量删除 + int currentSize = innerMap.size(); + if (currentSize > DIAGRAM_MAX_DATA_COUNT) { + int toRemove = currentSize - DIAGRAM_MAX_DATA_COUNT; + auto it = innerMap.begin(); + // 批量删除最旧的toRemove个元素 + for (int i = 0; i < toRemove && it != innerMap.end(); ++i) { + it = innerMap.erase(it); + } } } } diff --git a/diagramCavas/source/monitorAttributeDlg.cpp b/diagramCavas/source/monitorAttributeDlg.cpp index bbf3fd5..32be90d 100644 --- a/diagramCavas/source/monitorAttributeDlg.cpp +++ b/diagramCavas/source/monitorAttributeDlg.cpp @@ -61,6 +61,7 @@ void MonitorAttributeDlg::generateAttributeGroups(QUuid uid) MonitorAttributeGroupDlg* pDlg = new MonitorAttributeGroupDlg(); pDlg->setParent(this); pDlg->createGroupView(iter.value()); + connect(_pParent->getParent()->getModelController(),&FixedPortsModel::dataUpdated,pDlg,&MonitorAttributeGroupDlg::updateData); _pBox->addWidget(iter.key(),pDlg); } _curId = uid; diff --git a/diagramCavas/source/monitorAttributeGroupDlg.cpp b/diagramCavas/source/monitorAttributeGroupDlg.cpp index 76b3328..521d19b 100644 --- a/diagramCavas/source/monitorAttributeGroupDlg.cpp +++ b/diagramCavas/source/monitorAttributeGroupDlg.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "global.h" MonitorAttributeGroupDlg::MonitorAttributeGroupDlg(QWidget* parent) @@ -34,18 +35,18 @@ void MonitorAttributeGroupDlg::initial() _layout = new QVBoxLayout(this); } -void MonitorAttributeGroupDlg::createGroupView(QList lst) +void MonitorAttributeGroupDlg::createGroupView(QList lst,int nType) { QWidget* content = new QWidget(); QGridLayout* gridLayout = new QGridLayout(content); - gridLayout->setHorizontalSpacing(6); + gridLayout->setHorizontalSpacing(2); gridLayout->setVerticalSpacing(10); gridLayout->setContentsMargins(0, 0, 0, 0); // 设置列的最小宽度和拉伸比例 gridLayout->setColumnMinimumWidth(0, 30); // 标签列最小宽度 gridLayout->setColumnStretch(0, 1); // 标签列拉伸因子 - gridLayout->setColumnStretch(1, 5); // 控件列拉伸因子 + gridLayout->setColumnStretch(1, 8); // 控件列拉伸因子 int row = 0; for(auto& info : lst) { @@ -76,7 +77,7 @@ void MonitorAttributeGroupDlg::createGroupView(QList l setWidgetResizable(true); } -QWidget* MonitorAttributeGroupDlg::createEditor(monitorItemAttributeInfo info) +QWidget* MonitorAttributeGroupDlg::createEditor(monitorItemAttributeInfo info,int nType) { QWidget* pWidget = nullptr; if(info.nShowType == 0){ //正常显示 @@ -85,7 +86,12 @@ QWidget* MonitorAttributeGroupDlg::createEditor(monitorItemAttributeInfo info) } else{ //图表 QChartView* chartView = new QChartView(this); - chartView->setMinimumSize(200, 150); + QSize size; + if(nType == 0) + size = QSize(400,300); + else + size = QSize(600,400); + chartView->setMinimumSize(size); chartView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); chartView->setRenderHint(QPainter::Antialiasing); @@ -139,7 +145,7 @@ QWidget* MonitorAttributeGroupDlg::createEditor(monitorItemAttributeInfo info) chart->legend()->setAlignment(Qt::AlignBottom); QFont legendFont = chart->legend()->font(); - legendFont.setPointSize(8); // 设置图例字体大小 + legendFont.setPointSize(9); // 设置图例字体大小 chart->legend()->setFont(legendFont); } else if (info.nGraphType == 1) { @@ -165,67 +171,113 @@ QWidget* MonitorAttributeGroupDlg::createEditor(monitorItemAttributeInfo info) void MonitorAttributeGroupDlg::updateLineChartData(QChartView* chartView, const QVector& data) { - if (!chartView || !chartView->chart()) return; + if (!chartView || data.isEmpty()) return; QChart* chart = chartView->chart(); - if (chart->series().isEmpty()) return; + if (!chart) { + chart = new QChart(); + chart->setAnimationOptions(QChart::NoAnimation); + chartView->setChart(chart); + } - QLineSeries* series = qobject_cast(chart->series().first()); - if (!series) return; + QLineSeries* series = nullptr; + if (chart->series().isEmpty()) { + series = new QLineSeries(); + chart->addSeries(series); + } else { + series = qobject_cast(chart->series().first()); + if (!series) return; + } - // 清空旧数据,添加新数据 series->clear(); - series->append(data); - // 更新坐标轴范围 - if (!data.isEmpty()) { - QValueAxis* aX = nullptr; - QValueAxis* aY = nullptr; + // 计算数据范围 + qint64 minTime = std::numeric_limits::max(); + qint64 maxTime = std::numeric_limits::lowest(); + double minVal = std::numeric_limits::max(); + double maxVal = std::numeric_limits::lowest(); + for (const QPointF& point : data) { + qint64 t = static_cast(point.x()); + series->append(t, point.y()); + minTime = qMin(minTime, t); + maxTime = qMax(maxTime, t); + minVal = qMin(minVal, point.y()); + maxVal = qMax(maxVal, point.y()); + } - // 方法1:通过方向获取 - QList xAxes = chart->axes(Qt::Horizontal); - QList yAxes = chart->axes(Qt::Vertical); + // ========== 简单直接的方法:确保只有一个坐标轴 ========== + QDateTimeAxis* xAxis = nullptr; + QValueAxis* yAxis = nullptr; - for (QAbstractAxis* axis : xAxes) { - if (qobject_cast(axis)) { - aX = static_cast(axis); - break; - } + // 获取当前所有坐标轴 + QList allAxes = chart->axes(); + + // 如果坐标轴太多,清理所有 + //if (allAxes.size() > 2) { // 应该只有x轴和y轴 + for (auto axis : allAxes) { + chart->removeAxis(axis); + delete axis; } + allAxes.clear(); + //} - for (QAbstractAxis* axis : yAxes) { - if (qobject_cast(axis)) { - aY = static_cast(axis); - break; - } - } - - if (aX && aY) { - double minX = data.first().x(); - double maxX = data.last().x(); - double minY = std::numeric_limits::max(); - double maxY = std::numeric_limits::lowest(); - - for (const QPointF& point : data) { - minY = qMin(minY, point.y()); - maxY = qMax(maxY, point.y()); - } - - double margin = (maxY - minY) * 0.1; - aX->setRange(minX, maxX); - aY->setRange(minY - margin, maxY + margin); + // 在剩余的坐标轴中查找 + for (auto axis : allAxes) { + if (!xAxis && qobject_cast(axis)) { + xAxis = qobject_cast(axis); + } else if (!yAxis && qobject_cast(axis)) { + yAxis = qobject_cast(axis); } } + + // 创建缺失的坐标轴 + if (!xAxis) { + xAxis = new QDateTimeAxis(); + xAxis->setTitleText("时间"); + chart->addAxis(xAxis, Qt::AlignBottom); + } + + if (!yAxis) { + yAxis = new QValueAxis(); + yAxis->setTitleText("值"); + chart->addAxis(yAxis, Qt::AlignLeft); + } + + // 确保系列附加 + series->attachAxis(xAxis); + series->attachAxis(yAxis); + + // 设置范围和其他属性 + qint64 timeMargin = qMax((maxTime - minTime) * 0.05, 1000); + double valMargin = qMax((maxVal - minVal) * 0.1, 0.1); + + xAxis->setRange( + QDateTime::fromMSecsSinceEpoch(minTime - timeMargin), + QDateTime::fromMSecsSinceEpoch(maxTime + timeMargin) + ); + yAxis->setRange(minVal - valMargin, maxVal + valMargin); + + qint64 timeSpan = maxTime - minTime; + xAxis->setFormat((timeSpan > 3600000) ? "HH:mm:ss" : "HH:mm:ss.zzz"); + + xAxis->setTickCount(6); + yAxis->setTickCount(8); + yAxis->setLabelFormat("%.2f"); + + QFont font; + font.setPointSize(9); + xAxis->setLabelsFont(font); + yAxis->setLabelsFont(font); } void MonitorAttributeGroupDlg::updateData() { - if(_pParent){ + if(_pParent || _pDetailParent){ auto pModel = getModelController(); auto pMap = pModel->getMonitorPara(); QUuid uid = getCurUid(); - if(pMap.contains(uid)){ + if(!pMap.isEmpty() && pMap.contains(uid)){ auto info = pMap.value(uid); for(auto &widget:_curWidget){ @@ -237,12 +289,25 @@ void MonitorAttributeGroupDlg::updateData() if(data.sConnectPara == sPara){ if(nCate == 0){ QLabel* pLabel = dynamic_cast(widget); - pLabel->setText(data.sValue); + pLabel->setText(QString::number(data.mapValue.last())); } else{ - if(nGraph == 0){ // + if(nGraph == 0){ //折线图 + // 转换为 QVector + QVector points; + points.reserve(data.mapValue.size()); // 预分配内存以提高性能 + + // 遍历 QMap + for (auto it = data.mapValue.constBegin(); it != data.mapValue.constEnd(); ++it) { + // 将 quint64 时间戳转换为 qreal(QPointF 使用 qreal) + qint64 timestampMs = it.key() / 1000000; // 纳秒转毫秒 + points.append(QPointF(static_cast(timestampMs), it.value())); + } QChartView* pView = dynamic_cast(widget); - //updateLineChartData(pView,); + updateLineChartData(pView,points); + } + else if(nGraph == 1){ + } } } diff --git a/diagramCavas/source/monitorDetailAttributeDlg.cpp b/diagramCavas/source/monitorDetailAttributeDlg.cpp index fbfe483..97b94b7 100644 --- a/diagramCavas/source/monitorDetailAttributeDlg.cpp +++ b/diagramCavas/source/monitorDetailAttributeDlg.cpp @@ -2,6 +2,7 @@ #include "ui_monitorDetailAttributeDlg.h" #include "monitorAttributeGroupDlg.h" #include "monitorPanel.h" +#include "graphicsDataModel/fixedPortsModel.h" #include "global.h" MonitorDetailAttributeDlg::MonitorDetailAttributeDlg(QWidget *parent) @@ -57,6 +58,7 @@ void MonitorDetailAttributeDlg::generateAttributeGroups(QUuid uid) pDlg->setDetailParent(this); pDlg->setCurMode(1); pDlg->createGroupView(iter.value()); + connect(_pParent->getModelController(),&FixedPortsModel::dataUpdated,pDlg,&MonitorAttributeGroupDlg::updateData); _curGroups.insert(iter.key(),pDlg); } } diff --git a/diagramCavas/source/monitorPanel.cpp b/diagramCavas/source/monitorPanel.cpp index 6f1feeb..c22ba21 100644 --- a/diagramCavas/source/monitorPanel.cpp +++ b/diagramCavas/source/monitorPanel.cpp @@ -407,12 +407,16 @@ void MonitorPanel::detailItemSelected(QUuid uid) void MonitorPanel::onRunClicked() { - + if(_pModel){ + _pModel->startAcceptData(); + } } void MonitorPanel::onStopClicked() { - + if(_pModel){ + _pModel->stopAcceptData(_name); + } } void MonitorPanel::onSaveClicked() diff --git a/diagramCavas/ui/baseInfoDlg.ui b/diagramCavas/ui/baseInfoDlg.ui index d1b205a..70c734a 100644 --- a/diagramCavas/ui/baseInfoDlg.ui +++ b/diagramCavas/ui/baseInfoDlg.ui @@ -321,11 +321,33 @@ border-radius:5px; - 12 + -1 + Medium - + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + 设备库 @@ -342,11 +364,33 @@ border-radius:5px; - 12 + -1 + Medium - + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + 图标库 diff --git a/diagramCavas/ui/bayInfoDlg.ui b/diagramCavas/ui/bayInfoDlg.ui index 5b7bc2d..8faa41f 100644 --- a/diagramCavas/ui/bayInfoDlg.ui +++ b/diagramCavas/ui/bayInfoDlg.ui @@ -65,6 +65,30 @@ 20 + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + + diff --git a/diagramCavas/ui/bayManagerContentDlg.ui b/diagramCavas/ui/bayManagerContentDlg.ui index 17119a9..d9a389c 100644 --- a/diagramCavas/ui/bayManagerContentDlg.ui +++ b/diagramCavas/ui/bayManagerContentDlg.ui @@ -172,6 +172,53 @@ + + /* 标签页容器 */ +QTabWidget::pane { + border: 1px solid #e2e8f0; + border-radius: 4px; + background-color: white; + margin-top: 4px; +} + +/* 标签栏 */ +QTabWidget::tab-bar { + alignment: left; + padding: 1px 1px 0 1px; +} + +/* 单个标签 */ +QTabBar::tab { + background-color: #f8fafc; + color: #94a3b8; + border: 1px solid #e2e8f0; + border-bottom: none; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + padding: 6px 16px; + margin-right: 2px; + font-size: 11px; + font-weight: 500; +} + +/* 标签悬停 */ +QTabBar::tab:hover { + background-color: #f1f5f9; + color: #64748b; + border-color: #cbd5e1; +} + +/* 标签选中 */ +QTabBar::tab:selected { + background-color: white; + color: #1e293b; + border-color: #e2e8f0; + border-bottom-color: white; + font-weight: 500; + margin-bottom: -1px; + padding-top: 7px; +} + 0 diff --git a/diagramCavas/ui/bayManagerDlg.ui b/diagramCavas/ui/bayManagerDlg.ui index 7db802b..88e9cb4 100644 --- a/diagramCavas/ui/bayManagerDlg.ui +++ b/diagramCavas/ui/bayManagerDlg.ui @@ -49,7 +49,17 @@ - background-color: rgb(209, 209, 209); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -65,11 +75,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 间隔管理 @@ -146,6 +156,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -153,6 +193,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/confirmEditorDlg.ui b/diagramCavas/ui/confirmEditorDlg.ui index afd18e6..755dd13 100644 --- a/diagramCavas/ui/confirmEditorDlg.ui +++ b/diagramCavas/ui/confirmEditorDlg.ui @@ -48,7 +48,17 @@ font: 12pt "Microsoft YaHei UI"; - background-color: rgb(193, 193, 193); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -62,13 +72,13 @@ font: 12pt "Microsoft YaHei UI"; Microsoft YaHei UI - 12 + -1 false false - color: rgb(0, 0, 0); + 保存拓扑 @@ -188,6 +198,36 @@ font: 12pt "Microsoft YaHei UI"; + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -195,6 +235,36 @@ font: 12pt "Microsoft YaHei UI"; + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/ctExtraInfoDlg.ui b/diagramCavas/ui/ctExtraInfoDlg.ui index 22f3722..6944cd3 100644 --- a/diagramCavas/ui/ctExtraInfoDlg.ui +++ b/diagramCavas/ui/ctExtraInfoDlg.ui @@ -327,6 +327,30 @@ 23 + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + + diff --git a/diagramCavas/ui/diagramConnectSetting.ui b/diagramCavas/ui/diagramConnectSetting.ui index 438372e..83b39ef 100644 --- a/diagramCavas/ui/diagramConnectSetting.ui +++ b/diagramCavas/ui/diagramConnectSetting.ui @@ -43,7 +43,17 @@ - background-color: rgb(196, 196, 196); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -55,8 +65,7 @@ - color: rgb(0, 0, 0); -font: 12pt "Microsoft YaHei UI"; + 网络通信设置 @@ -81,6 +90,53 @@ font: 12pt "Microsoft YaHei UI"; + + /* 标签页容器 */ +QTabWidget::pane { + border: 1px solid #e2e8f0; + border-radius: 4px; + background-color: white; + margin-top: 4px; +} + +/* 标签栏 */ +QTabWidget::tab-bar { + alignment: left; + padding: 1px 1px 0 1px; +} + +/* 单个标签 */ +QTabBar::tab { + background-color: #f8fafc; + color: #94a3b8; + border: 1px solid #e2e8f0; + border-bottom: none; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + padding: 6px 16px; + margin-right: 2px; + font-size: 11px; + font-weight: 500; +} + +/* 标签悬停 */ +QTabBar::tab:hover { + background-color: #f1f5f9; + color: #64748b; + border-color: #cbd5e1; +} + +/* 标签选中 */ +QTabBar::tab:selected { + background-color: white; + color: #1e293b; + border-color: #e2e8f0; + border-bottom-color: white; + font-weight: 500; + margin-bottom: -1px; + padding-top: 7px; +} + 0 @@ -182,6 +238,30 @@ font: 12pt "Microsoft YaHei UI"; + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 测试节点推荐 @@ -229,6 +309,30 @@ font: 12pt "Microsoft YaHei UI"; + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 测试数据服务 @@ -385,6 +489,30 @@ font: 12pt "Microsoft YaHei UI"; + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 测试连接 @@ -466,6 +594,36 @@ font: 12pt "Microsoft YaHei UI"; + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 保存 @@ -473,6 +631,36 @@ font: 12pt "Microsoft YaHei UI"; + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/diagramEditorBayDetailAddDlg.ui b/diagramCavas/ui/diagramEditorBayDetailAddDlg.ui index 40a648b..f116342 100644 --- a/diagramCavas/ui/diagramEditorBayDetailAddDlg.ui +++ b/diagramCavas/ui/diagramEditorBayDetailAddDlg.ui @@ -46,7 +46,17 @@ - background-color: rgb(210, 210, 210); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -65,11 +75,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 新增线路 @@ -246,6 +256,36 @@ + + + 80 + 0 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 保存 @@ -306,6 +346,30 @@ + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 添加到线路 @@ -369,6 +433,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -376,6 +470,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/diagramEditorBayDetailSettingDlg.ui b/diagramCavas/ui/diagramEditorBayDetailSettingDlg.ui index 9b3d3a8..a03bc7d 100644 --- a/diagramCavas/ui/diagramEditorBayDetailSettingDlg.ui +++ b/diagramCavas/ui/diagramEditorBayDetailSettingDlg.ui @@ -40,7 +40,17 @@ - background-color: rgb(217, 217, 217); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -59,11 +69,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 间隔详细设置 @@ -126,6 +136,30 @@ + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 新增线路 @@ -133,6 +167,30 @@ + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 预览间隔 @@ -180,6 +238,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 载入 @@ -187,6 +275,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 保存 @@ -207,6 +325,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -214,6 +362,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/diagramEditorBaySettingDlg.ui b/diagramCavas/ui/diagramEditorBaySettingDlg.ui index 556f717..f44a48a 100644 --- a/diagramCavas/ui/diagramEditorBaySettingDlg.ui +++ b/diagramCavas/ui/diagramEditorBaySettingDlg.ui @@ -43,7 +43,17 @@ - background-color: rgb(196, 196, 196); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -59,11 +69,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 设置间隔 @@ -206,6 +216,30 @@ + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 添加 @@ -213,6 +247,30 @@ + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 删除 @@ -272,6 +330,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -279,6 +367,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/diagramEditorTransDetailAddDlg.ui b/diagramCavas/ui/diagramEditorTransDetailAddDlg.ui index 04d28ff..037b8e5 100644 --- a/diagramCavas/ui/diagramEditorTransDetailAddDlg.ui +++ b/diagramCavas/ui/diagramEditorTransDetailAddDlg.ui @@ -46,7 +46,17 @@ - background-color: rgb(210, 210, 210); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -65,11 +75,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 新增线路 @@ -246,6 +256,36 @@ + + + 80 + 0 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 保存 @@ -306,6 +346,30 @@ + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 添加到线路 @@ -369,6 +433,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -376,6 +470,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/diagramEditorTransDetailSettingDlg.ui b/diagramCavas/ui/diagramEditorTransDetailSettingDlg.ui index 5be994a..2739d57 100644 --- a/diagramCavas/ui/diagramEditorTransDetailSettingDlg.ui +++ b/diagramCavas/ui/diagramEditorTransDetailSettingDlg.ui @@ -40,7 +40,17 @@ - background-color: rgb(217, 217, 217); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -59,11 +69,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 变压器详细设置 @@ -139,6 +149,30 @@ + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 新增回路 @@ -146,6 +180,30 @@ + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 预览成套装置 @@ -153,6 +211,30 @@ + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 预览变压器 @@ -162,6 +244,53 @@ + + /* 标签页容器 */ +QTabWidget::pane { + border: 1px solid #e2e8f0; + border-radius: 4px; + background-color: white; + margin-top: 4px; +} + +/* 标签栏 */ +QTabWidget::tab-bar { + alignment: left; + padding: 1px 1px 0 1px; +} + +/* 单个标签 */ +QTabBar::tab { + background-color: #f8fafc; + color: #94a3b8; + border: 1px solid #e2e8f0; + border-bottom: none; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + padding: 6px 16px; + margin-right: 2px; + font-size: 11px; + font-weight: 500; +} + +/* 标签悬停 */ +QTabBar::tab:hover { + background-color: #f1f5f9; + color: #64748b; + border-color: #cbd5e1; +} + +/* 标签选中 */ +QTabBar::tab:selected { + background-color: white; + color: #1e293b; + border-color: #e2e8f0; + border-bottom-color: white; + font-weight: 500; + margin-bottom: -1px; + padding-top: 7px; +} + 0 @@ -227,6 +356,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 保存 @@ -234,6 +393,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 载入 @@ -254,6 +443,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -261,6 +480,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/diagramEditorTransSettingDlg.ui b/diagramCavas/ui/diagramEditorTransSettingDlg.ui index 3ae4164..7de69ef 100644 --- a/diagramCavas/ui/diagramEditorTransSettingDlg.ui +++ b/diagramCavas/ui/diagramEditorTransSettingDlg.ui @@ -43,7 +43,17 @@ - background-color: rgb(196, 196, 196); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -59,11 +69,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 设置变压器 @@ -153,6 +163,30 @@ + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 添加 @@ -160,6 +194,30 @@ + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 删除 @@ -286,6 +344,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -293,6 +381,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/diagramEditorWizard.ui b/diagramCavas/ui/diagramEditorWizard.ui index 18637c3..61d922e 100644 --- a/diagramCavas/ui/diagramEditorWizard.ui +++ b/diagramCavas/ui/diagramEditorWizard.ui @@ -49,6 +49,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 下一步 @@ -75,6 +105,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 完成 @@ -86,6 +146,52 @@ + + QTabWidget::pane { + border: 1px solid #e2e8f0; + border-radius: 4px; + background-color: white; + margin-top: 4px; +} + +/* 标签栏 */ +QTabWidget::tab-bar { + alignment: left; + padding: 1px 1px 0 1px; +} + +/* 单个标签 */ +QTabBar::tab { + background-color: #f8fafc; + color: #94a3b8; + border: 1px solid #e2e8f0; + border-bottom: none; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + padding: 6px 16px; + margin-right: 2px; + font-size: 11px; + font-weight: 500; +} + +/* 标签悬停 */ +QTabBar::tab:hover { + background-color: #f1f5f9; + color: #64748b; + border-color: #cbd5e1; +} + +/* 标签选中 */ +QTabBar::tab:selected { + background-color: white; + color: #1e293b; + border-color: #e2e8f0; + border-bottom-color: white; + font-weight: 500; + margin-bottom: -1px; + padding-top: 7px; +} + 0 @@ -124,6 +230,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 添加 @@ -221,11 +357,42 @@ + + + 80 + 20 + + - 12 + -1 + Medium + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 添加 @@ -274,6 +441,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 添加 @@ -288,6 +485,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 @@ -355,6 +582,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 上一步 diff --git a/diagramCavas/ui/itemPropertyDlg.ui b/diagramCavas/ui/itemPropertyDlg.ui index 9d8ba79..ea5f1b9 100644 --- a/diagramCavas/ui/itemPropertyDlg.ui +++ b/diagramCavas/ui/itemPropertyDlg.ui @@ -44,7 +44,17 @@ - background-color: rgb(183, 183, 183); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -63,14 +73,14 @@ - background-color: rgb(219, 219, 219); + - background-color: rgb(219, 219, 219); + @@ -88,7 +98,7 @@ - background-color: rgb(219, 219, 219); + @@ -105,7 +115,7 @@ 0 - 30 + 20 @@ -116,11 +126,33 @@ - 11 + -1 + Medium - color: rgb(6, 6, 6); + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + 确定 @@ -132,7 +164,7 @@ 0 - 30 + 20 @@ -143,11 +175,33 @@ - 11 + -1 + Medium - color: rgb(6, 6, 6); + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + 取消 diff --git a/diagramCavas/ui/loadMonitorPageDlg.ui b/diagramCavas/ui/loadMonitorPageDlg.ui index 2089223..98941b7 100644 --- a/diagramCavas/ui/loadMonitorPageDlg.ui +++ b/diagramCavas/ui/loadMonitorPageDlg.ui @@ -43,7 +43,17 @@ - background-color: rgb(192, 192, 192); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -55,8 +65,7 @@ - color: rgb(4, 4, 4); -font: 12pt "Microsoft YaHei UI"; + 载入运行时 @@ -86,6 +95,36 @@ font: 12pt "Microsoft YaHei UI"; + + + 0 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -93,6 +132,36 @@ font: 12pt "Microsoft YaHei UI"; + + + 0 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/measureSettingDlg.ui b/diagramCavas/ui/measureSettingDlg.ui index f426d13..7987f3e 100644 --- a/diagramCavas/ui/measureSettingDlg.ui +++ b/diagramCavas/ui/measureSettingDlg.ui @@ -49,7 +49,17 @@ - background-color: rgb(206, 206, 206); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -62,11 +72,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 量测设置 @@ -91,10 +101,104 @@ + + /* 标签页容器 */ +QTabWidget::pane { + border: 1px solid #e2e8f0; + border-radius: 4px; + background-color: white; + margin-top: 4px; +} + +/* 标签栏 */ +QTabWidget::tab-bar { + alignment: left; + padding: 1px 1px 0 1px; +} + +/* 单个标签 */ +QTabBar::tab { + background-color: #f8fafc; + color: #94a3b8; + border: 1px solid #e2e8f0; + border-bottom: none; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + padding: 6px 16px; + margin-right: 2px; + font-size: 11px; + font-weight: 500; +} + +/* 标签悬停 */ +QTabBar::tab:hover { + background-color: #f1f5f9; + color: #64748b; + border-color: #cbd5e1; +} + +/* 标签选中 */ +QTabBar::tab:selected { + background-color: white; + color: #1e293b; + border-color: #e2e8f0; + border-bottom-color: white; + font-weight: 500; + margin-bottom: -1px; + padding-top: 7px; +} + 0 + + /* 标签页容器 */ +QTabWidget::pane { + border: 1px solid #e2e8f0; + border-radius: 4px; + background-color: white; + margin-top: 4px; +} + +/* 标签栏 */ +QTabWidget::tab-bar { + alignment: left; + padding: 1px 1px 0 1px; +} + +/* 单个标签 */ +QTabBar::tab { + background-color: #f8fafc; + color: #94a3b8; + border: 1px solid #e2e8f0; + border-bottom: none; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + padding: 6px 16px; + margin-right: 2px; + font-size: 11px; + font-weight: 500; +} + +/* 标签悬停 */ +QTabBar::tab:hover { + background-color: #f1f5f9; + color: #64748b; + border-color: #cbd5e1; +} + +/* 标签选中 */ +QTabBar::tab:selected { + background-color: white; + color: #1e293b; + border-color: #e2e8f0; + border-bottom-color: white; + font-weight: 500; + margin-bottom: -1px; + padding-top: 7px; +} + 基本参数 @@ -892,6 +996,30 @@ 22 + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + - @@ -915,6 +1043,30 @@ 22 + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + + @@ -1198,12 +1350,42 @@ + + + 80 + 20 + + 80 22 + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 完成 @@ -1211,6 +1393,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/monitorConfigDlg.ui b/diagramCavas/ui/monitorConfigDlg.ui index 1f2dc25..ed084f6 100644 --- a/diagramCavas/ui/monitorConfigDlg.ui +++ b/diagramCavas/ui/monitorConfigDlg.ui @@ -49,7 +49,17 @@ - background-color: rgb(192, 192, 192); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -70,8 +80,7 @@ - color: rgb(0, 0, 0); -font: 12pt "Microsoft YaHei UI"; + 参数配置 @@ -96,6 +105,53 @@ font: 12pt "Microsoft YaHei UI"; + + /* 标签页容器 */ +QTabWidget::pane { + border: 1px solid #e2e8f0; + border-radius: 4px; + background-color: white; + margin-top: 4px; +} + +/* 标签栏 */ +QTabWidget::tab-bar { + alignment: left; + padding: 1px 1px 0 1px; +} + +/* 单个标签 */ +QTabBar::tab { + background-color: #f8fafc; + color: #94a3b8; + border: 1px solid #e2e8f0; + border-bottom: none; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + padding: 6px 16px; + margin-right: 2px; + font-size: 11px; + font-weight: 500; +} + +/* 标签悬停 */ +QTabBar::tab:hover { + background-color: #f1f5f9; + color: #64748b; + border-color: #cbd5e1; +} + +/* 标签选中 */ +QTabBar::tab:selected { + background-color: white; + color: #1e293b; + border-color: #e2e8f0; + border-bottom-color: white; + font-weight: 500; + margin-bottom: -1px; + padding-top: 7px; +} + 0 @@ -382,6 +438,36 @@ font: 12pt "Microsoft YaHei UI"; + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -389,6 +475,36 @@ font: 12pt "Microsoft YaHei UI"; + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/monitorDetailAttributeDlg.ui b/diagramCavas/ui/monitorDetailAttributeDlg.ui index cea7507..e52c36a 100644 --- a/diagramCavas/ui/monitorDetailAttributeDlg.ui +++ b/diagramCavas/ui/monitorDetailAttributeDlg.ui @@ -43,7 +43,17 @@ - background-color: rgb(191, 191, 191); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -58,8 +68,7 @@ - color: rgb(0, 0, 0); -font: 12pt "Microsoft YaHei UI"; + 属性详细信息 @@ -141,6 +150,36 @@ font: 12pt "Microsoft YaHei UI"; + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 退出详情 diff --git a/diagramCavas/ui/monitorDisplaySettingDlg.ui b/diagramCavas/ui/monitorDisplaySettingDlg.ui index 7d2c4b4..a8fb92c 100644 --- a/diagramCavas/ui/monitorDisplaySettingDlg.ui +++ b/diagramCavas/ui/monitorDisplaySettingDlg.ui @@ -49,7 +49,17 @@ - background-color: rgb(192, 192, 192); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -70,8 +80,7 @@ - color: rgb(0, 0, 0); -font: 12pt "Microsoft YaHei UI"; + 图元状态配置 @@ -262,6 +271,30 @@ font: 12pt "Microsoft YaHei UI"; + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 选择图标 @@ -313,6 +346,30 @@ font: 12pt "Microsoft YaHei UI"; + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 选择颜色 @@ -368,6 +425,36 @@ font: 12pt "Microsoft YaHei UI"; + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 保存 @@ -388,6 +475,36 @@ font: 12pt "Microsoft YaHei UI"; + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/projectDiagramNameInput.ui b/diagramCavas/ui/projectDiagramNameInput.ui index 66d1147..738691a 100644 --- a/diagramCavas/ui/projectDiagramNameInput.ui +++ b/diagramCavas/ui/projectDiagramNameInput.ui @@ -49,7 +49,17 @@ - background-color: rgb(200, 200, 200); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -62,11 +72,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 输入组态图名称 @@ -198,6 +208,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -205,6 +245,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/projectIconSetting.ui b/diagramCavas/ui/projectIconSetting.ui index 806c09d..9b99405 100644 --- a/diagramCavas/ui/projectIconSetting.ui +++ b/diagramCavas/ui/projectIconSetting.ui @@ -49,7 +49,17 @@ - background-color: rgb(180, 180, 180); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -65,11 +75,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 工程模图标设置 @@ -112,6 +122,36 @@ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 diff --git a/diagramCavas/ui/projectModelSetting.ui b/diagramCavas/ui/projectModelSetting.ui index af51d88..bd318c0 100644 --- a/diagramCavas/ui/projectModelSetting.ui +++ b/diagramCavas/ui/projectModelSetting.ui @@ -49,7 +49,17 @@ - background-color: rgb(177, 177, 177); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -71,11 +81,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 工程模配置 @@ -87,6 +97,53 @@ + + /* 标签页容器 */ +QTabWidget::pane { + border: 1px solid #e2e8f0; + border-radius: 4px; + background-color: white; + margin-top: 4px; +} + +/* 标签栏 */ +QTabWidget::tab-bar { + alignment: left; + padding: 1px 1px 0 1px; +} + +/* 单个标签 */ +QTabBar::tab { + background-color: #f8fafc; + color: #94a3b8; + border: 1px solid #e2e8f0; + border-bottom: none; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + padding: 6px 16px; + margin-right: 2px; + font-size: 11px; + font-weight: 500; +} + +/* 标签悬停 */ +QTabBar::tab:hover { + background-color: #f1f5f9; + color: #64748b; + border-color: #cbd5e1; +} + +/* 标签选中 */ +QTabBar::tab:selected { + background-color: white; + color: #1e293b; + border-color: #e2e8f0; + border-bottom-color: white; + font-weight: 500; + margin-bottom: -1px; + padding-top: 7px; +} + 0 @@ -205,6 +262,36 @@ color: rgb(8, 8, 8); + + + 40 + 0 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + >> @@ -212,6 +299,36 @@ color: rgb(8, 8, 8); + + + 40 + 0 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + << @@ -310,6 +427,36 @@ color: rgb(8, 8, 8); + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 选择 @@ -389,6 +536,36 @@ color: rgb(8, 8, 8); + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -396,6 +573,36 @@ color: rgb(8, 8, 8); + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/diagramCavas/ui/ptExtraInfoDlg.ui b/diagramCavas/ui/ptExtraInfoDlg.ui index 4e94f92..18e127f 100644 --- a/diagramCavas/ui/ptExtraInfoDlg.ui +++ b/diagramCavas/ui/ptExtraInfoDlg.ui @@ -325,6 +325,30 @@ 23 + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + + diff --git a/diagramCommunication/include/baseChannel.h b/diagramCommunication/include/baseChannel.h index 44dc23a..459a392 100644 --- a/diagramCommunication/include/baseChannel.h +++ b/diagramCommunication/include/baseChannel.h @@ -15,7 +15,7 @@ public: struct ChannelConfig { QString channelId; QUrl endpoint; - int timeout = 30000; // 超时时间(ms) + int timeout = 10000; // 超时时间(ms) int reconnectInterval = 5000; // 重连间隔(ms) int maxRetries = 3; // 最大重试次数 QVariantMap params; // 自定义参数 diff --git a/diagramCommunication/include/dataProcessor.h b/diagramCommunication/include/dataProcessor.h index c8e9ae9..ba9794e 100644 --- a/diagramCommunication/include/dataProcessor.h +++ b/diagramCommunication/include/dataProcessor.h @@ -17,7 +17,7 @@ public: // 处理数据 void processData(const QVariant& data,int conType = 0); - + void processNullData(const QVariant& data); // 获取处理后的数据 QVariant getProcessedData(const QString& key) const; diff --git a/diagramCommunication/include/uiCommunicationBus.h b/diagramCommunication/include/uiCommunicationBus.h index 4b24451..a5ef087 100644 --- a/diagramCommunication/include/uiCommunicationBus.h +++ b/diagramCommunication/include/uiCommunicationBus.h @@ -83,7 +83,7 @@ public: for (const auto& item : tempList) { //如果订阅不成功,从候选列表中移除 todo:记录错误target auto it = targetMap.find(item.first); if (it != targetMap.end()) { - if (it.value() == "1001") { + if (it.value() != "1001") { continue; // 跳过 } } diff --git a/diagramCommunication/include/webSocketChannel.h b/diagramCommunication/include/webSocketChannel.h index a2f78cf..4b1d5db 100644 --- a/diagramCommunication/include/webSocketChannel.h +++ b/diagramCommunication/include/webSocketChannel.h @@ -14,6 +14,7 @@ public: }; WebSocketChannel(const ChannelConfig& config, QString sessionId,QObject* parent = nullptr); + ~WebSocketChannel(); bool connect() override; bool disconnect() override; diff --git a/diagramCommunication/source/configManager.cpp b/diagramCommunication/source/configManager.cpp index 3abb19c..8b668c9 100644 --- a/diagramCommunication/source/configManager.cpp +++ b/diagramCommunication/source/configManager.cpp @@ -177,7 +177,7 @@ ChannelConfig ConfigManager::getDefaultWebSocketConfig() const config.id = "websocket_channel"; config.name = "实时数据推送"; - config.endpoint = "ws://192.168.1.101:8888/ws"; + config.endpoint = "ws://192.168.46.100:10080/monitors/data/realtime/stream/"; config.timeout = 10000; config.enabled = true; config.autoConnect = false; diff --git a/diagramCommunication/source/dataProcessor.cpp b/diagramCommunication/source/dataProcessor.cpp index c3b86d6..2117357 100644 --- a/diagramCommunication/source/dataProcessor.cpp +++ b/diagramCommunication/source/dataProcessor.cpp @@ -38,6 +38,11 @@ void DataProcessor::processData(const QVariant& data,int conType) } } +void DataProcessor::processNullData(const QVariant& data) +{ + emit httpProcessed("subscriptionTest",data); +} + void DataProcessor::processJson( const QVariant& data,int conType) { QJsonObject dataObj = data.toJsonObject(); diff --git a/diagramCommunication/source/httpChannel.cpp b/diagramCommunication/source/httpChannel.cpp index 53c6311..407af14 100644 --- a/diagramCommunication/source/httpChannel.cpp +++ b/diagramCommunication/source/httpChannel.cpp @@ -107,9 +107,15 @@ bool HttpChannel::post(const QByteArray& data, const QString& path) return false; } - QUrl url = m_config.endpoint; - if (!path.isEmpty()) { - url.setPath(url.path() + path); + QUrl url; + if(path.contains("http")){ //url全部输入 + url = QUrl(path); + } + else{ //url部分输入 + url = m_config.endpoint; + if (!path.isEmpty()) { + url.setPath(url.path() + path); + } } QNetworkAccessManager* manager = new QNetworkAccessManager(this); diff --git a/diagramCommunication/source/uiCommunicationBus.cpp b/diagramCommunication/source/uiCommunicationBus.cpp index 81693b6..d9259d9 100644 --- a/diagramCommunication/source/uiCommunicationBus.cpp +++ b/diagramCommunication/source/uiCommunicationBus.cpp @@ -61,9 +61,9 @@ void UiCommunicationBus::sendHttpRequest(const QString& endpoint, const QVariant bool success = comm->sendHttpRequest(endpoint, doc.toJson(),method,query); if (success) { - qDebug() << "HTTP请求已发送:" << endpoint; + qDebug() << "HTTP request send success:" << endpoint; } else { - qWarning() << "HTTP请求发送失败:" << endpoint; + qWarning() << "HTTP request send fail:" << endpoint; } } @@ -99,6 +99,9 @@ void UiCommunicationBus::onHttpDataReceived(const QByteArray& data) processor->processData(responseMap.value("payload")); } } + else{ + processor->processNullData(QVariant()); + } } qDebug() << "HTTP "; diff --git a/diagramCommunication/source/webSocketChannel.cpp b/diagramCommunication/source/webSocketChannel.cpp index 6f45bed..b16f892 100644 --- a/diagramCommunication/source/webSocketChannel.cpp +++ b/diagramCommunication/source/webSocketChannel.cpp @@ -17,6 +17,19 @@ WebSocketChannel::WebSocketChannel(const ChannelConfig& config, QString sessionI m_sessionId = sessionId; } +WebSocketChannel::~WebSocketChannel() +{ + if(m_webSocket){ + m_webSocket->disconnect(); + if (m_webSocket->state() == QAbstractSocket::ConnectedState) { + m_webSocket->close(); + } + + m_webSocket->deleteLater(); + m_webSocket = nullptr; + } +} + bool WebSocketChannel::connect() { if (m_webSocket->state() == QAbstractSocket::ConnectedState) { @@ -30,22 +43,21 @@ bool WebSocketChannel::connect() // 1. 从 WebSocket URL 提取 host 和 port QUrl url(m_config.endpoint); - QString host = url.host(); - int port = url.port(80); // 默认端口 80 + //QString host = url.host(); + //int port = url.port(10080); // 默认端口 80 // 2. 构建 Origin URL - QString origin = QString("http://%1:%2").arg(host).arg(port); + //QString origin = QString("http://%1:%2").arg(host).arg(port); // 3. 创建 QNetworkRequest 并设置 Origin QNetworkRequest request(url); - request.setRawHeader("Origin", origin.toUtf8()); + //request.setRawHeader("Origin", origin.toUtf8()); // 4. 使用 QWebSocket 连接 - QWebSocket *socket = new QWebSocket(); - socket->open(request); + m_webSocket->open(request); qDebug() << "WebSocket URL:" << m_config.endpoint; - qDebug() << "Origin:" << origin; + //qDebug() << "Origin:" << origin; return true; } diff --git a/diagramUtils/source/dataBase.cpp b/diagramUtils/source/dataBase.cpp index 19c6597..be84262 100644 --- a/diagramUtils/source/dataBase.cpp +++ b/diagramUtils/source/dataBase.cpp @@ -572,7 +572,7 @@ QString DataBase::getStationNameById(int id) QList DataBase::getAllGrid() { QList lst; - QString strSQL = "SELECT id, name, description FROM grid"; + QString strSQL = "SELECT id, tagname, name, description FROM grid"; try { @@ -581,8 +581,9 @@ QList DataBase::getAllGrid() { gridInfo info; info.id = query.value(0).toInt(); - info.name = query.value(1).toString(); - info.description = query.value(2).toString(); + info.tagname = query.value(1).toString(); + info.name = query.value(2).toString(); + info.description = query.value(3).toString(); lst.append(info); } query.clear(); @@ -597,7 +598,7 @@ QList DataBase::getAllGrid() QList DataBase::getAllZone() { QList lst; - QString strSQL = "SELECT id,grid_id,name,description FROM zone"; + QString strSQL = "SELECT id,grid_id,tagname,name,description FROM zone"; try { @@ -607,8 +608,9 @@ QList DataBase::getAllZone() zoneInfo info; info.id = query.value(0).toInt(); info.grid_id = query.value(1).toInt(); - info.name = query.value(2).toString(); - info.description = query.value(3).toString(); + info.tagname = query.value(2).toString(); + info.name = query.value(3).toString(); + info.description = query.value(4).toString(); lst.append(info); } query.clear(); @@ -623,7 +625,7 @@ QList DataBase::getAllZone() QList DataBase::getAllStation() { QList lst; - QString strSQL = "SELECT id,zone_id,name,description,is_local FROM station"; + QString strSQL = "SELECT id,zone_id,tagname,name,description,is_local FROM station"; try { @@ -633,9 +635,10 @@ QList DataBase::getAllStation() stationInfo info; info.id = query.value(0).toInt(); info.zone_id = query.value(1).toInt(); - info.name = query.value(2).toString(); - info.description = query.value(3).toString(); - info.is_local = query.value(4).toBool(); + info.tagname = query.value(2).toString(); + info.name = query.value(3).toString(); + info.description = query.value(4).toString(); + info.is_local = query.value(5).toBool(); lst.append(info); } query.clear(); diff --git a/include/baseDockWidget.h b/include/baseDockWidget.h new file mode 100644 index 0000000..03afe2e --- /dev/null +++ b/include/baseDockWidget.h @@ -0,0 +1,13 @@ +#ifndef BASEDOCKWIDGET_H +#define BASEDOCKWIDGET_H + +#include + +class BaseDockWidget : public QDockWidget +{ + Q_OBJECT +public: + explicit BaseDockWidget(const QString &title, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()); + ~BaseDockWidget(); +}; +#endif // BASEDOCKWIDGET_H diff --git a/source/baseDockWidget.cpp b/source/baseDockWidget.cpp new file mode 100644 index 0000000..650918e --- /dev/null +++ b/source/baseDockWidget.cpp @@ -0,0 +1,72 @@ +#include "baseDockWidget.h" + +BaseDockWidget::BaseDockWidget(const QString &title, QWidget *parent, Qt::WindowFlags flags) + : QDockWidget(title,parent,flags) +{ + setStyleSheet(R"( + QDockWidget { + border: 2px solid #e2e8f0; + border-radius: 6px; + background-color: white; + } + + QDockWidget::title { + background: qlineargradient(x1:0, y1:0, x2:0, y2:1, + stop:0 #f8fafc, + stop:1 #f1f5f9); + color: #334155; + padding: 10px 15px; + font-size: 13px; + font-weight: 600; + border-bottom: 2px solid #e2e8f0; + border-radius: 4px 4px 0 0; + } + + /* 悬停时的标题栏 */ + QDockWidget:hover::title { + background: #f8fafc; + color: #1e40af; + } + + /* 按钮样式 */ + QDockWidget::close-button, + QDockWidget::float-button { + border: 1px solid #cbd5e1; + background: white; + border-radius: 4px; + width: 20px; + height: 20px; + } + + QDockWidget::close-button:hover, + QDockWidget::float-button:hover { + background: #f1f5f9; + border-color: #94a3b8; + } + + QDockWidget::close-button:pressed, + QDockWidget::float-button:pressed { + background: #e2e8f0; + } + + /* 按钮位置 */ + QDockWidget::close-button { + subcontrol-position: top right; + subcontrol-origin: margin; + right: 10px; + top: 10px; + } + + QDockWidget::float-button { + subcontrol-position: top right; + subcontrol-origin: margin; + right: 35px; + top: 10px; + } +)"); +} + +BaseDockWidget::~BaseDockWidget() +{ + +} diff --git a/source/mainwindow.cpp b/source/mainwindow.cpp index b6c5129..aadfc36 100644 --- a/source/mainwindow.cpp +++ b/source/mainwindow.cpp @@ -27,9 +27,7 @@ #include "projectManager.h" #include "monitorItemsDlg.h" #include "monitorPagesDlg.h" - -//using namespace ads; - +#include "baseDockWidget.h" CMainWindow::CMainWindow(QWidget *parent) : QMainWindow(parent) @@ -92,7 +90,7 @@ void CMainWindow::initializeDockUi() m_pTopologyView = new TopologyView(this); m_pTopologyView->initial(); - QDockWidget* topologyDock = new QDockWidget(QString::fromWCharArray(L"拓扑关系"),this); + BaseDockWidget* topologyDock = new BaseDockWidget(QString::fromWCharArray(L"拓扑关系"),this); topologyDock->setWidget(m_pTopologyView); //topologyDock->setMinimumSize(120,550); topologyDock->setAllowedAreas(Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea); @@ -100,19 +98,19 @@ void CMainWindow::initializeDockUi() m_pDiagramView = new DiagramView(this); m_pDiagramView->initial(); - QDockWidget* diagramDock = new QDockWidget(QString::fromWCharArray(L"组态图列表"),this); + BaseDockWidget* diagramDock = new BaseDockWidget(QString::fromWCharArray(L"组态图列表"),this); diagramDock->setWidget(m_pDiagramView); diagramDock->setAllowedAreas(Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea); this->addDockWidget(Qt::LeftDockWidgetArea,diagramDock); m_pMonitorItemsDlg = new MonitorItemsDlg(this); - m_pMonitorItemsDock = new QDockWidget(QString::fromWCharArray(L"当前设备列表"),this); + m_pMonitorItemsDock = new BaseDockWidget(QString::fromWCharArray(L"当前设备列表"),this); m_pMonitorItemsDock->setWidget(m_pMonitorItemsDlg); m_pMonitorItemsDock->setAllowedAreas(Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea); this->addDockWidget(Qt::RightDockWidgetArea,m_pMonitorItemsDock); m_pMonitorPagesDlg = new MonitorPagesDlg(this); - m_pMonitorPagesDock = new QDockWidget(QString::fromWCharArray(L"监控列表"),this); + m_pMonitorPagesDock = new BaseDockWidget(QString::fromWCharArray(L"监控列表"),this); m_pMonitorPagesDock->setWidget(m_pMonitorPagesDlg); m_pMonitorPagesDock->setAllowedAreas(Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea); m_pMonitorPagesDock->setMinimumSize(120,550); diff --git a/ui/createEditor.ui b/ui/createEditor.ui index b0815f7..21cae44 100644 --- a/ui/createEditor.ui +++ b/ui/createEditor.ui @@ -40,7 +40,17 @@ - background-color: rgb(164, 164, 164); + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QLabel { + color: white; + font-size: 12px; + background: transparent; +} @@ -59,11 +69,11 @@ - 12 + -1 - color: rgb(0, 0, 0); + 新建 @@ -120,6 +130,36 @@ + + + 0 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -127,6 +167,36 @@ + + + 0 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 diff --git a/ui/diagramView.ui b/ui/diagramView.ui index a6e384b..8fbc9c6 100644 --- a/ui/diagramView.ui +++ b/ui/diagramView.ui @@ -36,6 +36,52 @@ 12 + + QTabWidget::pane { + border: 1px solid #e2e8f0; + border-radius: 4px; + background-color: white; + margin-top: 4px; +} + +/* 标签栏 */ +QTabWidget::tab-bar { + alignment: left; + padding: 1px 1px 0 1px; +} + +/* 单个标签 */ +QTabBar::tab { + background-color: #f8fafc; + color: #94a3b8; + border: 1px solid #e2e8f0; + border-bottom: none; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + padding: 6px 16px; + margin-right: 2px; + font-size: 11px; + font-weight: 500; +} + +/* 标签悬停 */ +QTabBar::tab:hover { + background-color: #f1f5f9; + color: #64748b; + border-color: #cbd5e1; +} + +/* 标签选中 */ +QTabBar::tab:selected { + background-color: white; + color: #1e293b; + border-color: #e2e8f0; + border-bottom-color: white; + font-weight: 500; + margin-bottom: -1px; + padding-top: 7px; +} + 0 @@ -57,6 +103,36 @@ + + + 0 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 新建项目 @@ -64,6 +140,36 @@ + + + 0 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 加载项目 @@ -71,6 +177,36 @@ + + + 0 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 保存设置 diff --git a/ui/loadPageDlg.ui b/ui/loadPageDlg.ui index bdaadc6..d819d72 100644 --- a/ui/loadPageDlg.ui +++ b/ui/loadPageDlg.ui @@ -6,42 +6,129 @@ 0 0 - 178 + 202 321 Dialog + + + - 10 + 0 - 10 + 0 - 10 + 0 - 10 + 0 - - 8 - - - 15 + + 0 - + + + + 0 + 21 + + + + QWidget { + background: #2c5282; + color: white; + border: none; +} + +QWidget QLabel { + color: white; + font-size: 12px; + background: transparent; +} + + + + 0 + + + 10 + + + 0 + + + 0 + + + 0 + + + + + 加载 + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + - + 20 + + + 0 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 确定 @@ -49,6 +136,36 @@ + + + 0 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 取消 @@ -56,6 +173,9 @@ + + + diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index 2e458b3..845cebb 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -13,6 +13,52 @@ DiagramDesigner + + QMenuBar { + background: qlineargradient(x1:0, y1:0, x2:0, y2:1, + stop:0 #2c5282, /* 顶部颜色 */ + stop:1 #1a365d); /* 底部颜色 */ + color: white; + border: none; + padding: 4px 0; + } + + QMenuBar::item { + padding: 8px 16px; + border: 1px solid transparent; + } + + QMenuBar::item:hover { + background-color: rgba(255, 255, 255, 0.1); + border: 1px solid rgba(255, 255, 255, 0.2); + } + + QMenuBar::item:pressed { + background-color: rgba(255, 255, 255, 0.2); + } +QMenu { + background-color: white; + border: 1px solid #cbd5e1; + color: #1e293b; + padding: 4px; + } + + QMenu::item { + padding: 6px 30px 6px 20px; + border-radius: 2px; + } + + QMenu::item:selected { + background-color: #2563eb; + color: white; + } + + QMenu::separator { + height: 1px; + background-color: #e2e8f0; + margin: 4px 8px; + } + @@ -20,7 +66,7 @@ 0 0 1696 - 17 + 38 diff --git a/ui/monitorItemsDlg.ui b/ui/monitorItemsDlg.ui index ae97171..799792f 100644 --- a/ui/monitorItemsDlg.ui +++ b/ui/monitorItemsDlg.ui @@ -49,7 +49,7 @@ 80 - 0 + 20 @@ -58,6 +58,30 @@ 16777215 + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 生成监控 diff --git a/ui/projectModelDlg.ui b/ui/projectModelDlg.ui index fb6f5b0..135c5e2 100644 --- a/ui/projectModelDlg.ui +++ b/ui/projectModelDlg.ui @@ -40,15 +40,13 @@ - QWidget#widget{ - background-color: rgb(232, 232, 232); -} + - background-color: rgb(200, 200, 200); + @@ -79,9 +77,9 @@ - background-color: rgb(165, 165, 165); + background-color: rgb(31, 92, 139); font: 12pt "Microsoft YaHei UI"; -color: rgb(8, 8, 8); +color: rgb(255, 255, 255); 模型索引 @@ -116,11 +114,42 @@ QTableView::item:selected + + + 80 + 20 + + - 12 + -1 + Medium + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 新建 @@ -151,13 +180,7 @@ QTableView::item:selected - QWidget#widget_right{ - background-color: rgb(200, 200, 200); -} -QWidget{ - color: rgb(3, 3, 3); - font: 12pt "Microsoft YaHei UI"; -} + @@ -175,6 +198,36 @@ QWidget{ + + + 40 + 0 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + >> @@ -197,6 +250,36 @@ QWidget{ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 保存 @@ -217,6 +300,36 @@ QWidget{ + + + 80 + 20 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + 关闭 @@ -247,9 +360,9 @@ QWidget{ - background-color: rgb(165, 165, 165); + background-color: rgb(31, 92, 139); font: 12pt "Microsoft YaHei UI"; -color: rgb(8, 8, 8); +color: rgb(255, 255, 255); 元模型属性 @@ -258,6 +371,36 @@ color: rgb(8, 8, 8); + + + 40 + 0 + + + + QPushButton { + background-color: #5a79a1; /* 中性灰蓝,不刺眼 */ + color: white; + border: none; /* 无边框,扁平化 */ + border-radius: 4px; /* 小圆角,扁平感 */ + font-size: 13px; /* 适中字号 */ + font-weight: 500; /* 中等字重 */ +} + +QPushButton:hover { + background-color: #4a5d7e; /* 稍深的灰蓝 */ +} + +QPushButton:pressed { + background-color: #3d4e6b; /* 更深的灰蓝 */ +} + +QPushButton:disabled { + background-color: #a0b3d1; /* 灰调的浅蓝 */ + color: #d1dce9; /* 浅灰色文字 */ +} + + << @@ -273,9 +416,9 @@ color: rgb(8, 8, 8); - background-color: rgb(165, 165, 165); + background-color: rgb(31, 92, 139); font: 12pt "Microsoft YaHei UI"; -color: rgb(8, 8, 8); +color: rgb(255, 255, 255); 工程模型属性 @@ -310,7 +453,7 @@ color: rgb(8, 8, 8); - background-color: rgb(200, 200, 200); +