mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 03:09:24 +08:00
[WEB]1.修改首页场站图标显示颜色不正确的问题,2.修改运行监控页面储能系统的运行模式和预制舱参数在页面切换时数据不显示问题
This commit is contained in:
@@ -22,6 +22,12 @@ static const std::string QSS_BTN_MENU_ACTIVE =
|
||||
"QPushButton:pressed {border-width:3px 0 0 3px;border-style:inset;}"
|
||||
"QPushButton:disabled {color:rgb(150,150,150);}";
|
||||
|
||||
static const std::string QSS_BTN_TAB =
|
||||
"QPushButton {background:rgba(80,80,80,100);color:white;border-radius:3px;border:1px solid rgb(10,120,215);}"
|
||||
"QPushButton:hover {background-color:rgba(80,80,80,200);}";
|
||||
//"QPushButton:pressed {border-width:3px 0 0 3px;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; }";
|
||||
|
||||
@@ -51,6 +57,10 @@ static const std::string QSS_TABLE = // 表格整体样式
|
||||
" color: rgb(220,220,220);" // 选中文字颜色
|
||||
"}";
|
||||
|
||||
static const std::string QSS_BTN_COMBOX =
|
||||
"QComboBox { background-color: transparent; border: 1px solid rgb(18, 251, 255)}"
|
||||
"QListView::item { background-color: rgba(80,80,80,200); color: white; padding-left: 10px; }";
|
||||
|
||||
MyWidget::MyWidget(QWidget* parent) : QWidget(parent)
|
||||
{
|
||||
// 可以在这里设置样式表,也可以在其他地方设置
|
||||
@@ -82,6 +92,21 @@ MyPairLabelLine MyQUI::PairLine(QWidget* parent, int x, int y, string k, string
|
||||
return {key, value};
|
||||
}
|
||||
|
||||
std::shared_ptr<QTableWidget> MyQUI::TableWidget(QWidget* parent, int x, int y, int w, int h)
|
||||
{
|
||||
auto table = std::make_shared<QTableWidget>(parent);
|
||||
table->setGeometry(x, y, w, h);
|
||||
table->setStyleSheet(QSS_TABLE.c_str());
|
||||
table->horizontalHeader()->setStretchLastSection(true); // 最后一列占满
|
||||
table->verticalHeader()->setVisible(false); // 不显示垂直表头
|
||||
table->setEditTriggers(QAbstractItemView::NoEditTriggers); // 单元格不可编辑
|
||||
table->setSelectionMode(QAbstractItemView::SingleSelection); // 设置为单选模式
|
||||
table->setSelectionBehavior(QAbstractItemView::SelectRows); // 设置为整行选中
|
||||
table->horizontalHeader()->setFixedHeight(50);
|
||||
table->horizontalHeader()->setDefaultSectionSize(60);
|
||||
return table;
|
||||
}
|
||||
|
||||
void MyQUI::setTableCell(std::shared_ptr<QTableWidget> table, int row, int col, std::string text, std::string style /*= ""*/)
|
||||
{
|
||||
if (row >= table->rowCount())
|
||||
|
||||
Reference in New Issue
Block a user