修改状态显示,添加组别
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user