class KLed |
|
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. Author Joerg Habenicht, Richard J. Moore (rich@kde.org) 1998, 1999 |
|
Constructs a green, round LED widget which will initially
be turned on.
parent - The parent widget. |
|
Constructs a round LED widget with the supplied color which will
initially be turned on.
color - Initial color of the LED. parent - The parent widget. Constructor |
|
Constructor with the color, state and look.
Differs from above only in the parameters, which configure all settings. 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 |
|
Returns the current color of the widget.
See also Color Returns LED color. |
|
Returns the factor to darken the LED.
See also setDarkFactor() Returns dark factor. |
|
Returns the width of the led. |
|
Returns the current look of the widget.
See also Look Returns LED look. |
|
|
Sets the state of the widget to Off.
The widget will be painted immediately. See also on() toggle() setState() |
|
Sets the state of the widget to On.
The widget will be painted immediately. See also off() toggle() setState() |
|
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 |
|
|
Paints a circular, flat LED. |
|
Paints a circular, raised LED. |
|
Paints a rectangular, flat LED. |
|
Paints a rectangular LED, either raised or sunken, depending on its argument. |
|
Paints a circular, sunken LED. |
|
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 color - New color of the LED. Sets the LED color. |
|
Sets the factor to darken the LED in KLed.Off state.
The darkFactor - should be greater than 100, otherwise the LED becomes lighter in KLed.Off state. Defaults to 300. See also QColor darkFactor - Sets the factor to darken the LED. Sets the factor to darken the LED. |
|
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 look - New look of the LED. Sets LED look. |
|
Set the shape of the LED.
shape - The LED shape. Set LED shape. |
|
Sets the state of the widget to On or Off.
The widget will be painted immediately. See also on() off() toggle() state - The LED state: on or off. Set LED state. |
|
Returns the current shape of the widget.
See also Shape Returns LED shape. |
|
|
Returns the current state of the widget (on/off).
See also State Returns LED state. |
|
Toggles the state of the led from Off to On or vice versa.
The widget repaints itself immediately. |
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: \n ( AMD K5/133, Diamond Stealth 64 PCI Graphics, widgetsize 29x29 )
The widget will be updated on the next repaining event.
LED look.
Flat | - | - | ||
Raised | - | - | ||
Sunken | - | - |
Shades of the lamp. LED shape
Rectangular | - | - | ||
Circular | - | - |
Status of the light is on/off. LED on/off.
Off | - | - | ||
On | - | - |