38 Q_PROPERTY(
bool on READ isOn WRITE setOn NOTIFY stateChanged)
39 Q_PROPERTY(
bool blinking READ isBlinking WRITE setBlinking NOTIFY blinkingChanged)
40 Q_PROPERTY(
int blinkRateMs READ blinkRateMs WRITE setBlinkRateMs NOTIFY appearanceChanged)
41 Q_PROPERTY(QColor onColor READ onColor WRITE setOnColor NOTIFY appearanceChanged)
42 Q_PROPERTY(QColor offColor READ offColor WRITE setOffColor NOTIFY appearanceChanged)
43 Q_PROPERTY(QColor bezelColor READ bezelColor WRITE setBezelColor NOTIFY appearanceChanged)
44 Q_PROPERTY(
bool bezelVisible READ isBezelVisible WRITE setBezelVisible NOTIFY appearanceChanged)
45 Q_PROPERTY(
bool glowEffect READ hasGlowEffect WRITE setGlowEffect NOTIFY appearanceChanged)
46 Q_PROPERTY(LedShape shape READ shape WRITE setShape NOTIFY appearanceChanged)
47 Q_PROPERTY(QString labelText READ labelText WRITE setLabelText NOTIFY appearanceChanged)
48 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor NOTIFY appearanceChanged)
49 Q_PROPERTY(
bool clickable READ isClickable WRITE setClickable NOTIFY appearanceChanged)
69 explicit LedIndicator(
const QColor &onColor, QWidget *parent =
nullptr);
73 [[nodiscard]]
bool isOn()
const;
75 [[nodiscard]]
bool isBlinking()
const;
77 [[nodiscard]]
int blinkRateMs()
const;
79 [[nodiscard]] QColor onColor()
const;
81 [[nodiscard]] QColor offColor()
const;
83 [[nodiscard]] QColor bezelColor()
const;
85 [[nodiscard]]
bool isBezelVisible()
const;
87 [[nodiscard]]
bool hasGlowEffect()
const;
89 [[nodiscard]] LedShape shape()
const;
91 [[nodiscard]] QString labelText()
const;
96 [[nodiscard]] QColor textColor()
const;
98 [[nodiscard]]
bool isClickable()
const;
100 [[nodiscard]] QSize sizeHint()
const override;
101 [[nodiscard]] QSize minimumSizeHint()
const override;
111 void setBlinking(
bool blinking);
113 void setBlinkRateMs(
int rateMs);
115 void setOnColor(
const QColor &color);
117 void setOffColor(
const QColor &color);
119 void setBezelColor(
const QColor &color);
121 void setBezelVisible(
bool visible);
123 void setGlowEffect(
bool glow);
125 void setShape(LedShape shape);
127 void setLabelText(
const QString &text);
132 void setTextColor(
const QColor &color);
134 void setClickable(
bool clickable);
138 void stateChanged(
bool on);
140 void blinkingChanged(
bool blinking);
144 void appearanceChanged();
147 void paintEvent(QPaintEvent *event)
override;
148 void mousePressEvent(QMouseEvent *event)
override;
151 void onBlinkTimeout();
154 [[nodiscard]] QColor calculateDefaultOffColor(
const QColor &onCol)
const;
156 std::unique_ptr<LedIndicatorPrivate> d_ptr;