mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
实现系统管理表格操作接口、分页操作
This commit is contained in:
@@ -102,10 +102,8 @@ int PvApp::label(PARAM* p, int parent, int x, int y, int w, int h, std::string t
|
||||
int id = PvApp::pvid(p);
|
||||
pvQLabel(p, id, parent);
|
||||
pvSetGeometry(p, id, x, y, w, h);
|
||||
pvSetFont(p, id, FONT_NAME, 14, 1, 0, 0, 0);
|
||||
pvSetFontColor(p, id, 255, 255, 255);
|
||||
if (!text.empty()) { pvSetText(p, id, text.c_str()); }
|
||||
if (!qss.empty()) { pvSetStyleSheet(p, id, qss.c_str()); }
|
||||
pvSetStyleSheet(p, id, qss.empty() ? qss::label().c_str() : qss.c_str());
|
||||
return id;
|
||||
}
|
||||
int PvApp::labelAlignCenter(PARAM* p, int parent, int x, int y, int w, int h, std::string text, std::string qss)
|
||||
@@ -120,10 +118,8 @@ int PvApp::button(PARAM* p, int parent, int x, int y, int w, int h, std::string
|
||||
int id = PvApp::pvid(p);
|
||||
pvQPushButton(p, id, parent);
|
||||
pvSetGeometry(p, id, x, y, w, h);
|
||||
pvSetFont(p, id, FONT_NAME, 14, 1, 0, 0, 0);
|
||||
pvSetFontColor(p, id, 255, 255, 255);
|
||||
if (!text.empty()) { pvSetText(p, id, text.c_str()); }
|
||||
if (!qss.empty()) { pvSetStyleSheet(p, id, qss.c_str()); }
|
||||
pvSetStyleSheet(p, id, qss.empty() ? qss::button().c_str() : qss.c_str());
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -141,7 +137,7 @@ int PvApp::combox(PARAM* p, int parent, int x, int y, int w, int h, const std::v
|
||||
int id = PvApp::pvid(p);
|
||||
pvQComboBox(p, id, parent, 0, 0);
|
||||
pvSetGeometry(p, id, x, y, w, h);
|
||||
pvSetStyleSheet(p, id, QSS_COMBOX_14.c_str());
|
||||
pvSetStyleSheet(p, id, qss::COMBOX_14.c_str());
|
||||
for (int i=0; i<vecItems.size(); ++i)
|
||||
{
|
||||
pvInsertItem(p, id, i, NULL, vecItems[i].c_str());
|
||||
@@ -155,7 +151,20 @@ int PvApp::lineEdit(PARAM* p, int parent, int x, int y, int w, int h, std::strin
|
||||
int id = PvApp::pvid(p);
|
||||
pvQLineEdit(p, id, parent);
|
||||
pvSetGeometry(p, id, x, y, w, h);
|
||||
pvSetStyleSheet(p, id, QSS_LINEEDIT.c_str());
|
||||
pvSetStyleSheet(p, id, qss::LINEEDIT.c_str());
|
||||
if (!text.empty()) { pvSetText(p, id, text.c_str()); }
|
||||
return id;
|
||||
}
|
||||
|
||||
int PvApp::textEdit(PARAM* p, int parent, int x, int y, int w, int h, std::string text, std::string qss)
|
||||
{
|
||||
static std::string qssTextEdit =
|
||||
"QTextEdit { background-color: rgb(12, 39, 58); border: 1px solid rgb(18, 251, 255); border-radius: 5px; color:white; font: bold 15px;}"
|
||||
"QTextEdit:disabled { border: 1px solid gray; color:rgb(150,150,150);}";
|
||||
int id = PvApp::pvid(p);
|
||||
pvQMultiLineEdit(p, id, parent, true, 10);
|
||||
pvSetGeometry(p, id, x, y, w, h);
|
||||
pvSetStyleSheet(p, id, qssTextEdit.c_str());
|
||||
if (!text.empty()) { pvSetText(p, id, text.c_str()); }
|
||||
return id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user