Displays a simple light widget that can be set to blink or change colors.
More...
|
| | LEDLightWidget (QWidget *parent=0) |
| | Constructs an LED light widget.
|
| RGBColor | currentColor () const |
| | Returns the current displayed color of the LED.
|
|
void | disableSlot () |
| | Manually turns off the LED.
|
|
void | enable () |
| | Manually turns on the LED.
|
| bool | lightToggledSignal (bool is_on) |
| | Emitted when the LED state changes.
|
| void | ping (int mSec=1000) |
| | Momentarily turns on the LED for a specified duration.
|
| void | setColor (QColor crOn, QColor crOff) |
| | Sets the LED on and off colors using QColor values.
|
| void | setColor (RGBColor crOn, RGBColor crOff=Constant< RGBColor >::Invalid) |
| | Sets the LED on and off colors using RGBColor values.
|
| QSize | sizeHint () const |
| | Returns the preferred size hint for the LED widget.
|
|
void | updateBlinkSlot () |
| | Slot that toggles the LED state for blink animation.
|
|
| void | paintEvent (QPaintEvent *paint_event) |
| | Paints the LED as a filled circle with the current color.
|
|
|
QTimer * | m_blink_timer = nullptr |
| | Timer used for continuous blink animation.
|
|
bool | m_is_on |
| | Whether the LED is currently on.
|
|
RGBColor | m_off_color |
| | The color displayed when the LED is off.
|
|
RGBColor | m_on_color |
| | The color displayed when the LED is on.
|
|
int | m_ping_cascade_count |
| | The number of overlapping ping requests currently active.
|
|
QTimer * | m_ping_timer = nullptr |
| | Timer used for temporary ping illumination.
|
Displays a simple light widget that can be set to blink or change colors.
Definition at line 12 of file LEDLightWidget.h.
◆ LEDLightWidget()
| LEDLightWidget::LEDLightWidget |
( |
QWidget * | parent = 0 | ) |
|
|
explicit |
Constructs an LED light widget.
- Parameters
-
| [in] | parent | The parent widget. |
◆ currentColor()
| RGBColor LEDLightWidget::currentColor |
( |
| ) |
const |
Returns the current displayed color of the LED.
- Returns
- The on or off color depending on the current state.
◆ lightToggledSignal()
| bool LEDLightWidget::lightToggledSignal |
( |
bool | is_on | ) |
|
Emitted when the LED state changes.
- Parameters
-
| [in] | is_on | True if the LED is now on, false if off. |
- Returns
- The signal return value.
◆ paintEvent()
| void LEDLightWidget::paintEvent |
( |
QPaintEvent * | paint_event | ) |
|
|
protected |
Paints the LED as a filled circle with the current color.
- Parameters
-
| [in] | paint_event | The paint event. |
◆ ping()
| void LEDLightWidget::ping |
( |
int | mSec = 1000 | ) |
|
Momentarily turns on the LED for a specified duration.
- Parameters
-
| [in] | mSec | The number of milliseconds to keep the LED on. |
◆ setColor() [1/2]
| void LEDLightWidget::setColor |
( |
QColor | crOn, |
|
|
QColor | crOff ) |
Sets the LED on and off colors using QColor values.
- Parameters
-
| [in] | crOn | The color displayed when the LED is on. |
| [in] | crOff | The color displayed when the LED is off. |
◆ setColor() [2/2]
Sets the LED on and off colors using RGBColor values.
- Parameters
-
| [in] | crOn | The color displayed when the LED is on. |
| [in] | crOff | The color displayed when the LED is off. Defaults to invalid (unchanged). |
◆ sizeHint()
| QSize LEDLightWidget::sizeHint |
( |
| ) |
const |
Returns the preferred size hint for the LED widget.
- Returns
- The preferred size.
The documentation for this class was generated from the following file: