Public Types |
| enum | Look { Flat,
Raised,
Sunken
} |
| enum | Shape { Rectangular,
Circular
} |
| enum | State { Off,
On
} |
Public Slots |
| void | off () |
| void | on () |
| void | toggle () |
Public Member Functions |
| | KLed (QWidget *parent=0) |
| | KLed (const QColor &color, QWidget *parent=0) |
| | KLed (const QColor &color, KLed::State state, KLed::Look look, KLed::Shape shape, QWidget *parent=0) |
| | ~KLed () |
| QColor | color () const |
| int | darkFactor () const |
| Look | look () const |
| virtual QSize | minimumSizeHint () const |
| void | setColor (const QColor &color) |
| void | setDarkFactor (int darkFactor) |
| void | setLook (Look look) |
| void | setShape (Shape shape) |
| void | setState (State state) |
| Shape | shape () const |
| virtual QSize | sizeHint () const |
| State | state () const |
Protected Member Functions |
| virtual int | ledWidth () const |
| bool | paintCachedPixmap () |
| void | paintEvent (QPaintEvent *) |
| virtual void | paintFlat () |
| void | paintLed (Shape shape, Look look) |
| virtual void | paintRaised () |
| virtual void | paintRect () |
| virtual void | paintRectFrame (bool raised) |
| virtual void | paintSunken () |
| void | resizeEvent (QResizeEvent *) |
| void | updateCachedPixmap () |
Properties |
| QColor | color |
| int | darkFactor |
| Look | look |
| Shape | shape |
| State | state |
An LED widget.
Displays a round or rectangular light emitting diode.
It is configurable to arbitrary colors, the two on/off states and three 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.
KDE LED Widget
- Author:
- Joerg Habenicht, Richard J. Moore (rich@kde.org) 1998, 1999
Definition at line 44 of file kled.h.
Displays 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.
Timings:
( AMD K5/133, Diamond Stealth 64 PCI Graphics, widgetsize 29x29 )
- flat Approximately 0.7 msec per paint
- round Approximately 2.9 msec per paint
- sunken Approximately 3.3 msec per paint
The widget will be updated on the next repaining event.
LED look.
- Enumerator:
-
Definition at line 88 of file kled.h.
| void KLed::setLook |
( |
Look |
look | ) |
|
Sets the look of the widget.
The look may be Flat, Raised or Sunken.
The widget calls the update() method, so it will be updated when entering the main event loop.
- See also:
- Look
- Parameters:
-
| look | New look of the LED. Sets LED look. |
Definition at line 223 of file kled.cpp.