Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
datatools::qt::led Class Reference

A LED widget with ON/OFF(/INDETERMINATE) status. More...

#include <bayeux/datatools/qt/led.h>

Inheritance diagram for datatools::qt::led:

Public Types

enum  led_color_type {
  Red = 0, Green, Yellow, Grey,
  Orange, Purple, Blue
}
 Supported colors. More...
 
enum  led_shape_type { Circle = 0, Square, Triangle, Rounded }
 Supported shapes. More...
 
enum  value_type { ValueOff = 0, ValueOn = 1, ValueIndeterminate = 2 }
 

Public Slots

void set_value (bool)
 Set the value. More...
 
void set_indeterminate ()
 Set the inderminate value. More...
 
void set (const boost::logic::tribool t_)
 Set the value. More...
 
void set_on_color (led_color_type)
 Set the ON color. More...
 
void set_off_color (led_color_type)
 Set the OFF color. More...
 
void set_indeterminate_color (led_color_type)
 Set the indeterminate color. More...
 
void set_shape (led_shape_type)
 Set the shape. More...
 
void toggle_value ()
 Toggle value. More...
 

Public Member Functions

 led (QWidget *parent=0)
 Default constructor. More...
 
 led (led_shape_type shape_, led_color_type on_color_, led_color_type off_color_, QWidget *parent=0)
 Default constructor. More...
 
 led (led_shape_type shape_, led_color_type on_color_, led_color_type off_color_, led_color_type indeterminate_color_, QWidget *parent=0)
 Default constructor. More...
 
virtual ~led ()
 Destructor. More...
 
bool get_value () const
 Return the value. More...
 
led_color_type get_on_color () const
 Return the ON color. More...
 
led_color_type get_off_color () const
 Return the OFF color. More...
 
led_color_type get_indeterminate_color () const
 Return the indeterminate color. More...
 
led_shape_type get_shape () const
 Return the shape. More...
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *event)
 Qt widget interface. More...
 
virtual QSize sizeHint () const
 Qt widget interface. More...
 
void _set_default ()
 Set default attributes. More...
 

Protected Attributes

bool _three_states_ = false
 
value_type _value
 Current value (On/Off) More...
 
led_color_type _on_color
 On color. More...
 
led_color_type _off_color
 Off color. More...
 
led_color_type _indeterminate_color
 Indeterminate color. More...
 
led_shape_type _shape
 Current shape of the LED. More...
 
QStringList _shapes
 List of supported shapes. More...
 
QStringList _colors
 List of supported colors. More...
 

Properties

bool value
 
led_color_type on_color
 
led_color_type off_color
 
led_color_type indeterminate_color
 
led_shape_type shape
 

Detailed Description

A LED widget with ON/OFF(/INDETERMINATE) status.

Member Enumeration Documentation

◆ led_color_type

Supported colors.

Enumerator
Red 
Green 
Yellow 
Grey 
Orange 
Purple 
Blue 

◆ led_shape_type

Supported shapes.

Enumerator
Circle 
Square 
Triangle 
Rounded 

◆ value_type

Enumerator
ValueOff 
ValueOn 
ValueIndeterminate 

Constructor & Destructor Documentation

◆ led() [1/3]

datatools::qt::led::led ( QWidget *  parent = 0)

Default constructor.

◆ led() [2/3]

datatools::qt::led::led ( led_shape_type  shape_,
led_color_type  on_color_,
led_color_type  off_color_,
QWidget *  parent = 0 
)

Default constructor.

◆ led() [3/3]

datatools::qt::led::led ( led_shape_type  shape_,
led_color_type  on_color_,
led_color_type  off_color_,
led_color_type  indeterminate_color_,
QWidget *  parent = 0 
)

Default constructor.

◆ ~led()

virtual datatools::qt::led::~led ( )
virtual

Destructor.

Member Function Documentation

◆ _set_default()

void datatools::qt::led::_set_default ( )
protected

Set default attributes.

◆ get_indeterminate_color()

led_color_type datatools::qt::led::get_indeterminate_color ( ) const
inline

Return the indeterminate color.

◆ get_off_color()

led_color_type datatools::qt::led::get_off_color ( ) const
inline

Return the OFF color.

◆ get_on_color()

led_color_type datatools::qt::led::get_on_color ( ) const
inline

Return the ON color.

◆ get_shape()

led_shape_type datatools::qt::led::get_shape ( ) const
inline

Return the shape.

◆ get_value()

bool datatools::qt::led::get_value ( ) const
inline

Return the value.

◆ paintEvent()

virtual void datatools::qt::led::paintEvent ( QPaintEvent *  event)
protectedvirtual

Qt widget interface.

◆ set

void datatools::qt::led::set ( const boost::logic::tribool  t_)
slot

Set the value.

◆ set_indeterminate

void datatools::qt::led::set_indeterminate ( )
slot

Set the inderminate value.

◆ set_indeterminate_color

void datatools::qt::led::set_indeterminate_color ( led_color_type  )
slot

Set the indeterminate color.

◆ set_off_color

void datatools::qt::led::set_off_color ( led_color_type  )
slot

Set the OFF color.

◆ set_on_color

void datatools::qt::led::set_on_color ( led_color_type  )
slot

Set the ON color.

◆ set_shape

void datatools::qt::led::set_shape ( led_shape_type  )
slot

Set the shape.

◆ set_value

void datatools::qt::led::set_value ( bool  )
slot

Set the value.

◆ sizeHint()

virtual QSize datatools::qt::led::sizeHint ( ) const
protectedvirtual

Qt widget interface.

◆ toggle_value

void datatools::qt::led::toggle_value ( )
slot

Toggle value.

Member Data Documentation

◆ _colors

QStringList datatools::qt::led::_colors
protected

List of supported colors.

◆ _indeterminate_color

led_color_type datatools::qt::led::_indeterminate_color
protected

Indeterminate color.

◆ _off_color

led_color_type datatools::qt::led::_off_color
protected

Off color.

◆ _on_color

led_color_type datatools::qt::led::_on_color
protected

On color.

◆ _shape

led_shape_type datatools::qt::led::_shape
protected

Current shape of the LED.

◆ _shapes

QStringList datatools::qt::led::_shapes
protected

List of supported shapes.

◆ _three_states_

bool datatools::qt::led::_three_states_ = false
protected

◆ _value

value_type datatools::qt::led::_value
protected

Current value (On/Off)

Property Documentation

◆ indeterminate_color

led_color_type datatools::qt::led::indeterminate_color
readwrite

◆ off_color

led_color_type datatools::qt::led::off_color
readwrite

◆ on_color

led_color_type datatools::qt::led::on_color
readwrite

◆ shape

led_shape_type datatools::qt::led::shape
readwrite

◆ value

bool datatools::qt::led::value
readwrite

The documentation for this class was generated from the following file: