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 (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 |
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
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 |
enum KLed::Shape |
enum KLed::State |
Constructor & Destructor Documentation
|
explicit |
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
Member Function Documentation
QColor KLed::color | ( | ) | const |
Returns the current color of the widget.
- See also
- Color Returns LED color.
int KLed::darkFactor | ( | ) | const |
Returns the factor to darken the LED.
- See also
- setDarkFactor() Returns dark factor.
|
protectedvirtual |
|
slot |
Sets the state of the widget to Off.
The widget will be painted immediately.
- See also
- on() toggle() setState()
|
slot |
Sets the state of the widget to On.
The widget will be painted immediately.
- See also
- off() toggle() setState()
|
protected |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
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.
void KLed::setDarkFactor | ( | int | darkFactor | ) |
void KLed::setLook | ( | Look | look | ) |
void KLed::setShape | ( | Shape | shape | ) |
void KLed::setState | ( | State | state | ) |
Shape KLed::shape | ( | ) | const |
State KLed::state | ( | ) | const |
|
slot |
|
protected |
Property Documentation
|
readwrite |
|
readwrite |
|
readwrite |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.