KLed Class Reference
from PyKDE4.kdeui import *
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.

"KDE LED Widget"
Enumerations | |
Look | { Flat, Raised, Sunken } |
Shape | { Rectangular, Circular } |
State | { Off, On } |
Methods | |
__init__ (self, QWidget parent=0) | |
__init__ (self, QColor color, QWidget parent=0) | |
__init__ (self, QColor color, KLed.State state, KLed.Look look, KLed.Shape shape, QWidget parent=0) | |
QColor | color (self) |
int | darkFactor (self) |
int | ledWidth (self) |
KLed.Look | look (self) |
QSize | minimumSizeHint (self) |
off (self) | |
on (self) | |
bool | paintCachedPixmap (self) |
paintEvent (self, QPaintEvent a0) | |
paintFlat (self) | |
paintRaised (self) | |
paintRect (self) | |
paintRectFrame (self, bool raised) | |
paintSunken (self) | |
setColor (self, QColor color) | |
setDarkFactor (self, int darkFactor) | |
setLook (self, KLed.Look look) | |
setShape (self, KLed.Shape shape) | |
setState (self, KLed.State state) | |
KLed.Shape | shape (self) |
QSize | sizeHint (self) |
KLed.State | state (self) |
toggle (self) |
Method Documentation
__init__ | ( | self, | ||
QWidget | parent=0 | |||
) |
__init__ | ( | self, | ||
QColor | color, | |||
KLed.State | state, | |||
KLed.Look | look, | |||
KLed.Shape | shape, | |||
QWidget | parent=0 | |||
) |
QColor color | ( | self ) |
Returns the current color of the widget.
- See also:
- Color
int darkFactor | ( | self ) |
Returns the factor to darken the LED.
- See also:
- setDarkFactor()
int ledWidth | ( | self ) |
Returns the width of the led.
KLed.Look look | ( | self ) |
Returns the current look of the widget.
- See also:
- Look
QSize minimumSizeHint | ( | self ) |
off | ( | self ) |
Sets the state of the widget to Off.
The widget will be painted immediately.
- See also:
- on() toggle() setState()
on | ( | self ) |
Sets the state of the widget to On.
The widget will be painted immediately.
- See also:
- off() toggle() setState()
bool paintCachedPixmap | ( | self ) |
Paint the cached antialiased pixmap corresponding to the state if any
- Returns:
- true if the pixmap was painted, false if it hasn't been created yet
paintEvent | ( | self, | ||
QPaintEvent | a0 | |||
) |
paintFlat | ( | self ) |
Paints a circular, flat LED.
paintRaised | ( | self ) |
Paints a circular, raised LED.
paintRect | ( | self ) |
Paints a rectangular, flat LED.
paintRectFrame | ( | self, | ||
bool | raised | |||
) |
Paints a rectangular LED, either raised or sunken, depending on its argument.
paintSunken | ( | self ) |
Paints a circular, sunken LED.
setColor | ( | self, | ||
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 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 | ( | self, | ||
int | darkFactor | |||
) |
Sets the factor to darken the LED in KLed.Off state.
The
- Parameters:
-
darkFactor should be greater than 100, otherwise the LED becomes lighter in KLed.Off state.
Defaults to 300.
- See also:
- QColor
- Parameters:
-
darkFactor Sets the factor to darken the LED.
Sets the factor to darken the LED.
setLook | ( | self, | ||
KLed.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.
setShape | ( | self, | ||
KLed.Shape | shape | |||
) |
Set the shape of the LED.
- Parameters:
-
shape The LED shape.
Set LED shape.
setState | ( | self, | ||
KLed.State | state | |||
) |
Sets the state of the widget to On or Off.
The widget will be painted immediately.
- See also:
- on() off() toggle()
- Parameters:
-
state The LED state: on or off.
Set LED state.
KLed.Shape shape | ( | self ) |
Returns the current shape of the widget.
- See also:
- Shape
QSize sizeHint | ( | self ) |
KLed.State state | ( | self ) |
Returns the current state of the widget (on/off).
- See also:
- State
toggle | ( | self ) |
Toggles the state of the led from Off to On or vice versa.
The widget repaints itself immediately.
Enumeration Documentation
Look |
- Enumerator:
-
Shape |
- Enumerator:
-
State |
- Enumerator:
-