Ref T111, blink function for LED

This commit is contained in:
Klaus Basan
2017-08-09 02:40:23 +02:00
committed by Mathew Sutcliffe
parent ccdfa8e12f
commit c2ff451415
2 changed files with 19 additions and 11 deletions

View File

@@ -237,6 +237,11 @@ namespace BlackGui
setLed(); setLed();
} }
void CLedWidget::blink(int resetTimeMs)
{
this->setOn(true, resetTimeMs);
}
void CLedWidget::setTriState(int resetTimeMs) void CLedWidget::setTriState(int resetTimeMs)
{ {
if (resetTimeMs < 0 && m_resetTimer.isActive()) { m_resetTimer.stop();} if (resetTimeMs < 0 && m_resetTimer.isActive()) { m_resetTimer.stop();}

View File

@@ -65,6 +65,9 @@ namespace BlackGui
//! Allows to set the led value {true, false} //! Allows to set the led value {true, false}
void setOn(bool on, int resetTimeMs = -1); void setOn(bool on, int resetTimeMs = -1);
//! Set to on for resetTimeMs
void blink(int resetTimeMs = 500);
//! Sets the 3rd state //! Sets the 3rd state
void setTriState(int resetTimeMs = -1); void setTriState(int resetTimeMs = -1);
@@ -144,7 +147,7 @@ namespace BlackGui
QString m_tooltipOn = "on"; //!< tooltip when on QString m_tooltipOn = "on"; //!< tooltip when on
QString m_tooltipOff = "off"; //!< tooltip when off QString m_tooltipOff = "off"; //!< tooltip when off
QString m_tooltipTriState = "tri-state"; //!< tooltip tri state QString m_tooltipTriState = "tri-state"; //!< tooltip tri-state
QString m_currentToolTip = "off"; //!< currently used tooltip QString m_currentToolTip = "off"; //!< currently used tooltip
QScopedPointer<QSvgRenderer> m_renderer; //!< Renderer QScopedPointer<QSvgRenderer> m_renderer; //!< Renderer
QTimer m_resetTimer { this }; //!< reset state QTimer m_resetTimer { this }; //!< reset state