mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 03:09:24 +08:00
1.新增服务端UI界面,显示服务基础信息。2.修改设备显示配置。3.监控页面储能系统显示储能模式,模式设置新增'手动'
This commit is contained in:
35
src/qt/MyQUI.cpp
Normal file
35
src/qt/MyQUI.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "MyQUI.h"
|
||||
|
||||
static const std::string QSS_GROUP =
|
||||
"QGroupBox { border: 1px solid gray; margin-top: 8px; border-radius: 5px;}"
|
||||
"QGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; left:10px; margin-left: 0px; padding:0 1px; }";
|
||||
|
||||
|
||||
static const std::string QSS_BTN_MENU =
|
||||
"QPushButton {background:rgba(50,128,218,200);color:white;border-radius:5px;border:2px solid rgb(10,120,215);font:bold 18px;}"
|
||||
"QPushButton:hover {background-color:rgb(32,164,128);}"
|
||||
"QPushButton:pressed {border-width:3px 0 0 3px;background-color:rgb(1,32,54);border-style:inset;}"
|
||||
"QPushButton:disabled {color:rgb(150,150,150);}";
|
||||
|
||||
static const std::string QSS_LINE =
|
||||
"QLineEdit { background-color: rgb(14, 49, 66); color: #ffffff; border: 1px solid gray; border-radius: 5px; font: bold 13px; }";
|
||||
|
||||
std::shared_ptr<QGroupBox> MyQUI::GroupBox(QWidget* parent, int x, int y, int w, int h, std::string title)
|
||||
{
|
||||
auto groupBox = std::make_shared<QGroupBox>(title.c_str(), parent);
|
||||
groupBox->setGeometry(x, y, w, h);
|
||||
groupBox->setStyleSheet(QSS_GROUP.c_str());
|
||||
return groupBox;
|
||||
}
|
||||
|
||||
void MyQUI::PairLine(QWidget* parent, int x, int y, string k, string v)
|
||||
{
|
||||
auto key = new QLabel(parent);
|
||||
key->setText(k.c_str());
|
||||
key->setGeometry(x, y, 80, 26);
|
||||
auto value = new QLineEdit(parent);
|
||||
value->setText(v.c_str());
|
||||
value->setGeometry(x+80, y, 260, 26);
|
||||
value->setStyleSheet(QSS_LINE.c_str());
|
||||
value->setReadOnly(true);
|
||||
}
|
||||
Reference in New Issue
Block a user