#include "qcled.h"

QCLED::QCLED(QWidget *parent, Qt::WindowFlags /*f*/)
    : QLabel(parent)
{
    iledNum   = 0;
    iledColor = 0;
    tglLED    = 0;
    wht();   // start in off (white) state
    connect(this, SIGNAL(clicked()),        this, SLOT(toggleLED()));
    connect(this, SIGNAL(onoff_switch(int)),this, SLOT(OnOffLED(int)));
}

QCLED::~QCLED() {}

void QCLED::mousePressEvent(QMouseEvent * /*event*/)
{
    emit clicked();
}

void QCLED::ext_ctrl(int i)
{
    emit onoff_switch(i);
}

