hled.h 573 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#ifndef HLED_H
#define HLED_H

#include <QWidget>

class QColor;

class HLed : public QWidget
{
    Q_OBJECT
public:
    HLed(QWidget *parent = 0);
    ~HLed();

    QColor color() const;
    QSize sizeHint() const;
    QSize minimumSizeHint() const;

public slots:
    void setColor(const QColor &color);
    void toggle();
    void turnOn(bool on=true);
    void turnOff(bool off=true);

protected:
    void paintEvent(QPaintEvent *);
    int ledWidth() const;

private:
    struct Private;
    Private * const m_d;
};

#endif // HLED_H