KDEUI
#include <kled.h>

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 (const QColor &color, KLed::State state, KLed::Look look, KLed::Shape shape, QWidget *parent=0) | |
KLed (const QColor &color, QWidget *parent=0) | |
KLed (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 |
Detailed Description
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.

Member Enumeration Documentation
◆ Look
enum KLed::Look |
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 | |
---|---|
Flat | |
Raised | |
Sunken |
◆ Shape
enum KLed::Shape |
◆ State
enum KLed::State |
Constructor & Destructor Documentation
◆ KLed() [1/3]
|
explicit |
◆ KLed() [2/3]
|
explicit |
◆ KLed() [3/3]
KLed::KLed | ( | const QColor & | color, |
KLed::State | state, | ||
KLed::Look | look, | ||
KLed::Shape | shape, | ||
QWidget * | parent = 0 |
||
) |
Constructor with the color, state and look.
Differs from above only in the parameters, which configure all settings.
- Parameters
-
color Initial color of the LED. state Sets the State. look Sets the Look. shape Sets the Shape (rectangular or circular). parent The parent widget.
Constructor
◆ ~KLed()
Member Function Documentation
◆ color()
QColor KLed::color | ( | ) | const |
◆ darkFactor()
int KLed::darkFactor | ( | ) | const |
◆ ledWidth()
|
protectedvirtual |
◆ look()
KLed::Look KLed::look | ( | ) | const |
◆ minimumSizeHint()
◆ off
|
slot |
◆ on
|
slot |
◆ paintCachedPixmap()
|
protected |
◆ paintEvent()
◆ paintFlat()
|
protectedvirtual |
◆ paintLed()
◆ paintRaised()
|
protectedvirtual |
◆ paintRect()
|
protectedvirtual |
◆ paintRectFrame()
|
protectedvirtual |
◆ paintSunken()
|
protectedvirtual |
◆ resizeEvent()
◆ setColor()
void KLed::setColor | ( | const QColor & | color | ) |
Set the color of the widget.
The LED is shown with Color when in the KLed::On state or with the darken Color (
- See also
- setDarkFactor) in KLed::Off state.
The widget calls the update() method, so it will be updated when entering the main event loop.
- See also
- Color
- Parameters
-
color New color of the LED.
Sets the LED color.
◆ setDarkFactor()
void KLed::setDarkFactor | ( | int | darkFactor | ) |
◆ setLook()
void KLed::setLook | ( | Look | look | ) |
◆ setShape()
void KLed::setShape | ( | Shape | shape | ) |
◆ setState()
void KLed::setState | ( | State | state | ) |
◆ shape()
KLed::Shape KLed::shape | ( | ) | const |
◆ sizeHint()
◆ state()
KLed::State KLed::state | ( | ) | const |
◆ toggle
|
slot |
◆ updateCachedPixmap()
|
protected |
Property Documentation
◆ color
◆ darkFactor
◆ look
◆ shape
◆ state
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.