修改状态显示,添加组别

This commit is contained in:
hm
2021-04-14 18:23:36 +08:00
parent 6cf9db9378
commit a29cb30b61
14 changed files with 338 additions and 1114 deletions
+66
View File
@@ -0,0 +1,66 @@
#include "StateGroup.h"
StateGroup::StateGroup(QWidget *parent) : QWidget(parent)
{
}
StateGroup::~StateGroup()
{
foreach (StateWidget * w, ItemList) {
delete w;
}
}
void StateGroup::addItem(StateWidget * w)
{
ItemList.insert(ItemList.size(),w);//逐渐往上加
//检查界面,添加到界面
}
void StateGroup::addItems(QMap<int, StateWidget *> list)
{
foreach (StateWidget *w, list) {
addItem(w);
}
}
void StateGroup::setValue(int index,QString value)
{
if(ItemList.contains(index))
{
ItemList.value(index)->setValue(value);
}
}
void StateGroup::setState(int index,StateWidget::state s)
{
if(ItemList.contains(index))
{
ItemList.value(index)->setColor(s);
}
}
void StateGroup::updateUI(void)
{
}