KLed Class Reference

[kdeui Index] [kdeui Hierarchy] [Headers]


A round led widget More...

#include <kled.h>

Inherits: QWidget (qt)

Public Members

Public Slots

Protected Members

Private Members


Detailed Description

KLed displays a round light emmiting diode.

It is configurable to 5 colors and the 2 on/off states.

It may display itself in a performant flat view, a round view with light spot or a round view sunken in the screen.


enum Color ( yellow, orange, red, green, blue ) [public]

color of the led

enum State ( Off=0, On=1 ) [public]

Status of the light is on/off

enum Look ( flat, round, sunken ) [public]

Displays a flat, round or round-sunken led. Displaying the led flat is less time and color consuming, but not so nice to see.

The sunken led itself is (for shure) 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 approx. 0.7 msec per paint - round approx. 2.9 msec per paint - sunken approx. 3.3 msec per paint

The widget will be updated the next repaining event.

inline State getState() const [public]

Hands back the current state of the widget (on/off) see enum State

inline Color getColor() const [public]

Hands back the color of the widget see enum Color

inline QRgb getRgbColor() const [public]

Hands back the color of the widget in RGB value. The value depends on the state of the the led (on, off) see QRgb

inline Look getLook() const [public]

Hands back the look of the widget see enum Look

inline void setState( State state ) [public]

sets the state of the widget to On or Off. The widget will be painted immediately. see also: on(), off(), toggle(), toggleState()

Parameters:
state the led state on or off

inline void toggleState() [public]

toggles the state of the led from Off to On and vice versa. The widget will be repainted when returning to the main event loop.

inline void setColor( KLed::Color color ) [public]

Sets the color of the widget. The widget calls the update method, so it will be updated when entering the main event loop.

see also: enum Color

Parameters:
color new Color of the led

inline void setLook( Look look ) [public]

Sets 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.

see also: enum Look

Parameters:
look new look of the led

inline void toggle() [public slot]

toggles the state of the led from Off to On an vice versa. The widget repaints itself immediately.

inline void on() [public slot]

sets the state of the widget to On. The widget will be painted immediately. see off(), toggle(), toggleState(), setState()

inline void off() [public slot]

sets the state of the widget to Off. The widget will be painted immediately. see also: on(), toggle(), toggleState(), setState()


  • Author: Jörg Habenicht
  • Documentation generated by root@darkstar.lst.de on Wed Sep 8 17:38:27 CEST 1999
Kdoc