70 lines
999 B
C++
70 lines
999 B
C++
#include "StatusUI.h"
|
|
#include "ui_StatusUI.h"
|
|
|
|
StatusUI::StatusUI(QWidget *parent) :
|
|
QWidget(parent),
|
|
ui(new Ui::StatusUI)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
//load qss
|
|
QFile file(":/qss/StatusUI.qss");
|
|
file.open(QFile::ReadOnly);
|
|
QTextStream filetext(&file);
|
|
QString stylesheet = filetext.readAll();
|
|
this->setStyleSheet(stylesheet);
|
|
file.close();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
StatusUI::~StatusUI()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
|
|
|
|
//void StatusUI::setColor(QWidget *w,state s)
|
|
//{
|
|
/*
|
|
w->setProperty("state",s);
|
|
w->style()->unpolish(w);
|
|
w->style()->polish(w);
|
|
*/
|
|
//}
|
|
|
|
void StatusUI::setValue(QLabel *w,QString s)
|
|
{
|
|
w->setText(s);
|
|
}
|
|
|
|
void StatusUI::install(int flag, QString name, QVariant value)
|
|
{
|
|
StateWidget *w = new StateWidget(flag,name,value);
|
|
|
|
|
|
|
|
|
|
|
|
StateList.insert(name,w);
|
|
}
|
|
|
|
void StatusUI::setValue(QString name,QVariant value)
|
|
{
|
|
if(StateList.keys().contains(name))
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|