halfenergyicon.cpp
471 Bytes
#include "halfenergyicon.h"
#include "config.h"
HalfEnergyIcon::HalfEnergyIcon(QWidget *parent) : QLabel(parent)
{
setPixmap(QPixmap(":/images/symbol/half_energy.png"));
connect(&timer, SIGNAL(timeout()), SLOT(check()));
timer.start(1000);
check();
}
void HalfEnergyIcon::check()
{
Define::config_item item = Config::getInstance()->getConfigValue(Define::config_set_half_energy);
if (item.d32 == 0)
hide();
else
show();
}