eric4.E4Gui.E4Led

Module implementing a LED widget.

It was inspired by KLed.

Classes

E4Led Class implementing a LED widget.

Functions

None


E4Led

Class implementing a LED widget.

Derived from

QWidget

Methods

E4Led Constructor
__getBestRoundSize Private method to calculate the width of the LED.
__paintRound Private method to paint a round raised LED.
color Public method to return the LED color.
darkFactor Public method to return the dark factor.
isFramed Public method to return the framed state.
isOn Public method to return the LED state.
minimumSizeHint Public method to give a hint about our minimum size.
off Public slot to set the LED to off.
on Public slot to set the LED to on.
paintEvent Protected slot handling the paint event.
setColor Public slot to set the LED color.
setDarkFactor Public method to set the dark factor.
setFramed Public slot to set the __framedLed attribute.
setOn Public slot to set the LED to on.
sizeHint Public method to give a hint about our desired size.
toggle Public slot to toggle the LED state.

E4Led (Constructor)

E4Led(parent = None, color = None)

Constructor

parent
reference to parent widget (QWidget)
color
color of the LED (QColor)

E4Led.__getBestRoundSize

__getBestRoundSize()

Private method to calculate the width of the LED.

Returns:
new width of the LED (integer)

E4Led.__paintRound

__paintRound()

Private method to paint a round raised LED.

E4Led.color

color()

Public method to return the LED color.

Returns:
color of the LED (QColor)

E4Led.darkFactor

darkFactor()

Public method to return the dark factor.

Returns:
the current dark factor (integer)

E4Led.isFramed

isFramed()

Public method to return the framed state.

Returns:
flag indicating the current framed state (boolean)

E4Led.isOn

isOn()

Public method to return the LED state.

Returns:
flag indicating the light state (boolean)

E4Led.minimumSizeHint

minimumSizeHint()

Public method to give a hint about our minimum size.

Returns:
size hint (QSize)

E4Led.off

off()

Public slot to set the LED to off.

E4Led.on

on()

Public slot to set the LED to on.

E4Led.paintEvent

paintEvent(evt)

Protected slot handling the paint event.

evt
paint event object (QPaintEvent)

E4Led.setColor

setColor(color)

Public slot to set the LED color.

color
color for the LED (QColor)

E4Led.setDarkFactor

setDarkFactor(darkfactor)

Public method to set the dark factor.

darkfactor
value to set for the dark factor (integer)

E4Led.setFramed

setFramed(framed)

Public slot to set the __framedLed attribute.

framed
flag indicating the framed state (boolean)

E4Led.setOn

setOn(state)

Public slot to set the LED to on.

state
new state of the LED (boolean)

E4Led.sizeHint

sizeHint()

Public method to give a hint about our desired size.

Returns:
size hint (QSize)

E4Led.toggle

toggle()

Public slot to toggle the LED state.

Up