|
| GaugeWidget (QWidget *parent=nullptr) |
| Constructor.
|
|
void | setRange (int min, int max) |
| Set the gauge range.
|
|
void | setTitle (const QString &title) |
| Set the title text displayed on the gauge.
|
|
void | setUnit (const QString &unit) |
| Set the unit text displayed with the value.
|
|
double | value () const |
| Get the current gauge value.
|
|
void | update_value (const double value) |
| Update the gauge value with optional animation.
|
|
| GaugeWidget (QWidget *parent=nullptr) |
| Constructor.
|
|
void | setRange (int min, int max) |
| Set the gauge range.
|
|
void | setTitle (const QString &title) |
| Set the title text displayed on the gauge.
|
|
void | setUnit (const QString &unit) |
| Set the unit text displayed with the value.
|
|
double | value () const |
| Get the current gauge value.
|
|
void | update_value (const double value) |
| Update the gauge value with optional animation.
|
|
|
static constexpr int | DEF_MIN_VALUE { 0 } |
| Default minimum value of the gauge.
|
|
static constexpr int | DEF_MAX_VALUE { 100 } |
| Default maximum value of the gauge.
|
|
static constexpr short | TITLE_FONT_SZ { 12 } |
| Font size for the title text.
|
|
static constexpr short | CURVAL_FOUT_SZ { 10 } |
| Font size for the current value text.
|
|
static constexpr int | ANIMATION_DURATION { 500 } |
| Duration of animation in milliseconds.
|
|
static constexpr float | WIDGET_MIN_WIDTH { 200 } |
| Minimum widget width.
|
|
static constexpr float | WIDGET_MIN_HEIGHT { 200 } |
| Minimum widget height.
|
|
static constexpr QColor | BOARD_COLOR = QColor(160, 160, 160) |
| Base color for the gauge board.
|
|
static constexpr QColor | FROM_BOARD_COLOR = QColor(190, 190, 190) |
| Gradient start color for board.
|
|
static constexpr QColor | TO_BOARD_COLOR = QColor(110, 110, 110) |
| Gradient end color for board.
|
|
static constexpr short | BOARD_LEN = 1 |
| Width of the board outline.
|
|
static constexpr short | START_ANGLE { 225 } |
| Start angle for gauge drawing (degrees)
|
|
static constexpr short | TOTAL_ANGLE { 270 } |
| Total sweep angle of gauge arc (degrees)
|
|
static constexpr short | COLOR_GRAD_WIDTH { 8 } |
| Width of the color gradient arc.
|
|
static constexpr short | COLOR_RADIUS { 90 } |
| Radius for the gradient arc.
|
|
static constexpr QColor | START_COLOR = QColor(255, 0, 0) |
| Gradient start color for the gauge arc.
|
|
static constexpr QColor | END_COLOR = QColor(0, 255, 0) |
| Gradient end color for the gauge arc.
|
|
static constexpr int | TICK_CNT { 55 } |
| Total number of ticks on the gauge.
|
|
static constexpr short | MAIN_TICK_WIDTH { 2 } |
| Width of main ticks.
|
|
static constexpr short | SUB_TICK_WIDTH { 1 } |
| Width of sub ticks.
|
|
static constexpr short | MAIN_TICK_LENGTH { 8 } |
| Length of main ticks.
|
|
static constexpr short | SUB_TICK_LENGTH { 5 } |
| Length of sub ticks.
|
|
static constexpr short | SUB_MAIN_RATE { 5 } |
| Number of sub ticks per main tick.
|
|
static constexpr QColor | TICK_COLOR = QColor(255, 255, 255) |
| Color of the ticks.
|
|
static constexpr short | LABEL_FONT_SZ { 6 } |
| Font size for labels on ticks.
|
|
static constexpr QColor | LABEL_COLOR = QColor(255, 255, 255) |
| Color for labels.
|
|
A customizable gauge widget for displaying numeric values.
This widget provides a circular gauge with configurable range, title, unit, and smooth animated value updates. It supports drawing ticks, labels, needle, and gradient arcs.