41 Q_PROPERTY(
double value READ value WRITE setValue NOTIFY valueChanged)
42 Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
43 Q_PROPERTY(
int digitCount READ digitCount WRITE setDigitCount NOTIFY appearanceChanged)
44 Q_PROPERTY(
int decimalPlaces READ decimalPlaces WRITE setDecimalPlaces NOTIFY appearanceChanged)
45 Q_PROPERTY(
bool showLeadingZeros READ showLeadingZeros WRITE setShowLeadingZeros NOTIFY appearanceChanged)
46 Q_PROPERTY(
bool showDecimalPoint READ showDecimalPoint WRITE setShowDecimalPoint NOTIFY appearanceChanged)
47 Q_PROPERTY(
double skewAngle READ skewAngle WRITE setSkewAngle NOTIFY appearanceChanged)
48 Q_PROPERTY(
double segmentWidthRatio READ segmentWidthRatio WRITE setSegmentWidthRatio NOTIFY appearanceChanged)
49 Q_PROPERTY(QColor activeSegmentColor READ activeSegmentColor WRITE setActiveSegmentColor NOTIFY appearanceChanged)
50 Q_PROPERTY(QColor inactiveSegmentColor READ inactiveSegmentColor WRITE setInactiveSegmentColor NOTIFY appearanceChanged)
51 Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY appearanceChanged)
52 Q_PROPERTY(QColor bezelColor READ bezelColor WRITE setBezelColor NOTIFY appearanceChanged)
53 Q_PROPERTY(
bool bezelVisible READ isBezelVisible WRITE setBezelVisible NOTIFY appearanceChanged)
64 [[nodiscard]]
double value()
const;
66 [[nodiscard]] QString text()
const;
68 [[nodiscard]]
int digitCount()
const;
70 [[nodiscard]]
int decimalPlaces()
const;
72 [[nodiscard]]
bool showLeadingZeros()
const;
74 [[nodiscard]]
bool showDecimalPoint()
const;
76 [[nodiscard]]
double skewAngle()
const;
78 [[nodiscard]]
double segmentWidthRatio()
const;
81 [[nodiscard]] QColor activeSegmentColor()
const;
83 [[nodiscard]] QColor inactiveSegmentColor()
const;
85 [[nodiscard]] QColor backgroundColor()
const;
87 [[nodiscard]] QColor bezelColor()
const;
89 [[nodiscard]]
bool isBezelVisible()
const;
91 [[nodiscard]] QSize sizeHint()
const override;
92 [[nodiscard]] QSize minimumSizeHint()
const override;
96 void setValue(
double value);
98 void setText(
const QString &text);
100 void display(
double value);
102 void display(
int value);
104 void display(
const QString &text);
107 void setDigitCount(
int count);
109 void setDecimalPlaces(
int places);
111 void setShowLeadingZeros(
bool show);
113 void setShowDecimalPoint(
bool show);
115 void setSkewAngle(
double angle);
117 void setSegmentWidthRatio(
double ratio);
120 void setActiveSegmentColor(
const QColor &color);
122 void setInactiveSegmentColor(
const QColor &color);
124 void setBackgroundColor(
const QColor &color);
126 void setBezelColor(
const QColor &color);
128 void setBezelVisible(
bool visible);
132 void valueChanged(
double value);
134 void textChanged(
const QString &text);
136 void appearanceChanged();
139 void paintEvent(QPaintEvent *event)
override;
142 void updateFormattedText();
143 static quint8 encodeChar(QChar ch);
144 void drawDigit(QPainter &painter,
const QRectF &rect, quint8 mask,
bool hasDecimalPoint)
const;
146 std::unique_ptr<SevenSegmentDisplayPrivate> d_ptr;