|
|
Display a round or rectangular light emmitting diode.
It is configurable to 5 colors, the 2 on/off states and 3 styles (or "looks");
It may display itself in a performant flat view, a round view with light spot or a round view sunken in the screen.
enum State {Off, On, NoOfStates } |
Status of the light is on/off.
enum Shape {NoShape, Rectangular, Circular, NoOfShapes=Circular } |
Shades of the lamp.
enum Look {NoLook, Flat, Raised, Sunken, NoOfLooks=Sunken } |
Display a flat, round or sunken LED.
Displaying the LED flat is less time and color consuming, but not so nice to see.
The sunken LED itself is (certainly) smaller than the round LED because of the 3 shading circles and is most time consuming. Makes sense for LED > 15x15 pixels.
The widget will be updated on the next repaining event.
KLed (const QColor &col=Qt::green, QWidget *parent=0, const char *name=0) |
Constructor with the ledcolor, the parent widget, and the name.
The State will be defaulted On and the Look round.
Parameters:
ledcolor | Initial color of the LED. |
parent | Will be handed over to QWidget. |
name | Will be handed over to QWidget. |
KLed (const QColor& col, KLed::State st, KLed::Look look, KLed::Shape shape, QWidget *parent=0, const char *name=0) |
Constructor with the ledcolor, ledstate, ledlook, the parent widget, and the name.
Differs from above only in the parameters, which configure all settings.
Parameters:
ledcolor | Initial color of the LED. |
state | Sets the State. |
look | Sets the Look. |
parent | Will be handed over to QWidget. |
name | Will be handed over to QWidget. |
State state () |
Hand back the current state of the widget (on/off).
const QColor color () |
Hand back the color of the widget
Look look () |
Hand back the look of the widget.
void setState ( State state ) |
Sets the state of the widget to On or Off.
The widget will be painted immediately.
Parameters:
state | The LED state: on or off. |
See also: on(), off(), toggle(), toggleState()
void setShape (Shape s) |
Set the shape.
void toggleState () |
Toggle the state of the LED from Off to On and vice versa.
The widget will be repainted when returning to the main event loop.
void setColor (const QColor& color) |
Set the color of the widget.
The widget calls the update() method, so it will be updated when entering the main event loop.
Parameters:
color | New color of the LED. |
void setLook ( Look look ) |
Set the look of the widget.
The look may be flat, round or sunken. The widget calls the update() method, so it will be updated when entering the main event loop.
Parameters:
look | New look of the LED. |
void toggle () |
Toggle the state of the led from Off to On or vice versa.
The widget repaints itself immediately.
void on () |
Sets the state of the widget to On.
The widget will be painted immediately.
See also: off(), toggle(), toggleState(), setState()
void off () |
Sets the state of the widget to Off.
The widget will be painted immediately.
See also: on(), toggle(), toggleState(), setState()