Files
gcs-nf/App/StatusUI/StatusUI.cpp
T

70 lines
999 B
C++
Raw Normal View History

#include "StatusUI.h"
2020-10-08 17:32:13 +08:00
#include "ui_StatusUI.h"
StatusUI::StatusUI(QWidget *parent) :
QWidget(parent),
ui(new Ui::StatusUI)
{
ui->setupUi(this);
2020-10-09 13:30:11 +08:00
//load qss
QFile file(":/qss/StatusUI.qss");
2020-10-09 13:30:11 +08:00
file.open(QFile::ReadOnly);
QTextStream filetext(&file);
QString stylesheet = filetext.readAll();
this->setStyleSheet(stylesheet);
file.close();
2021-03-06 11:17:03 +08:00
2020-10-08 17:32:13 +08:00
}
StatusUI::~StatusUI()
{
delete ui;
}
2020-10-09 13:30:11 +08:00
2021-01-12 12:15:03 +08:00
//void StatusUI::setColor(QWidget *w,state s)
//{
/*
2020-10-09 13:30:11 +08:00
w->setProperty("state",s);
w->style()->unpolish(w);
w->style()->polish(w);
2021-01-12 12:15:03 +08:00
*/
//}
2020-10-09 13:30:11 +08:00
void StatusUI::setValue(QLabel *w,QString s)
{
w->setText(s);
}
2021-03-06 11:17:03 +08:00
void StatusUI::install(int flag, QString name, QVariant value)
2020-10-10 15:25:17 +08:00
{
2021-03-06 11:17:03 +08:00
StateWidget *w = new StateWidget(flag,name,value);
2020-12-04 01:46:02 +08:00
2021-01-17 21:44:41 +08:00
2021-01-26 20:06:35 +08:00
2021-03-06 11:17:03 +08:00
StateList.insert(name,w);
2020-10-28 13:48:15 +08:00
}
2021-03-06 11:17:03 +08:00
void StatusUI::setValue(QString name,QVariant value)
2020-10-28 13:48:15 +08:00
{
2021-03-06 11:17:03 +08:00
if(StateList.keys().contains(name))
{
2020-12-04 01:46:02 +08:00
}
}
2020-10-28 13:48:15 +08:00
2021-01-12 12:15:03 +08:00
2020-10-28 13:48:15 +08:00