19 #ifndef QROUNDPROGRESSBAR_H
20 #define QROUNDPROGRESSBAR_H
66 static const int PositionLeft = 180;
67 static const int PositionTop = 90;
68 static const int PositionRight = 0;
69 static const int PositionBottom = -90;
153 QString
format()
const {
return m_format; }
170 double value()
const {
return m_value; }
189 void setRange(
double min,
double max);
216 virtual void paintEvent(QPaintEvent *event);
217 virtual void drawBackground(QPainter& p,
const QRectF& baseRect);
218 virtual void drawBase(QPainter& p,
const QRectF& baseRect);
219 virtual void drawValue(QPainter& p,
const QRectF& baseRect,
double value,
double arcLength);
220 virtual void calculateInnerRect(
const QRectF& baseRect,
double outerRadius, QRectF& innerRect,
double& innerRadius);
221 virtual void drawInnerBackground(QPainter& p,
const QRectF& innerRect);
222 virtual void drawText(QPainter& p,
const QRectF& innerRect,
double innerRadius,
double value);
223 virtual QString valueToText(
double value)
const;
224 virtual void valueFormatChanged();
226 virtual QSize minimumSizeHint()
const {
return QSize(32,32); }
228 virtual bool hasHeightForWidth()
const {
return true; }
229 virtual int heightForWidth(
int w)
const {
return w; }
231 void rebuildDataBrushIfNeeded();
236 double m_nullPosition;
238 double m_outlinePenWidth, m_dataPenWidth;
240 QGradientStops m_gradientData;
246 static const int UF_VALUE = 1;
247 static const int UF_PERCENT = 2;
248 static const int UF_MAX = 4;
252 #endif // QROUNDPROGRESSBAR_H
void setBarStyle(BarStyle style)
Sets visual style of the widget.
Definition: QRoundProgressBar.cpp:102
The QRoundProgressBar class represents a circular progress bar and maintains its API similar to the Q...
Definition: QRoundProgressBar.h:60
double outlinePenWidth() const
Returns width of the outline circle pen.
Definition: QRoundProgressBar.h:114
void setMinimum(double min)
Defines minimum of the allowed value range. If the current value does not fit into the range...
Definition: QRoundProgressBar.cpp:59
void setRange(double min, double max)
Defines minimum und maximum of the allowed value range. If the current value does not fit into the ra...
Definition: QRoundProgressBar.cpp:40
void setNullPosition(double position)
Defines position of minimum value.
Definition: QRoundProgressBar.cpp:89
void resetFormat()
Sets format string to empty string. No text will be shown therefore. See setFormat() for more informa...
Definition: QRoundProgressBar.cpp:153
double maximum() const
Returns maximum of the allowed value range.
Definition: QRoundProgressBar.h:180
void setMaximum(double max)
Defines maximum of the allowed value range. If the current value does not fit into the range...
Definition: QRoundProgressBar.cpp:64
void setDataColors(const QGradientStops &stopPoints)
Sets colors of the visible data and makes gradient brush from them. Gradient colors can be set for Do...
Definition: QRoundProgressBar.cpp:132
BarStyle
The BarStyle enum defines general look of the progress bar.
Definition: QRoundProgressBar.h:86
double dataPenWidth() const
Returns width of the data circle pen.
Definition: QRoundProgressBar.h:124
void setOutlinePenWidth(double penWidth)
Sets width of the outline circle pen.
Definition: QRoundProgressBar.cpp:112
double nullPosition() const
Return position (in degrees) of minimum value.
Definition: QRoundProgressBar.h:75
void setDecimals(int count)
Sets number of decimals to show after the comma (default is 1).
Definition: QRoundProgressBar.cpp:160
BarStyle barStyle() const
Returns current progree bar style.
Definition: QRoundProgressBar.h:104
Pie style (filled pie segment with the text in center)
Definition: QRoundProgressBar.h:91
double value() const
Returns current value shown on the widget.
Definition: QRoundProgressBar.h:170
void setDataPenWidth(double penWidth)
Sets width of the data circle pen.
Definition: QRoundProgressBar.cpp:122
Line style (thin round line around the text)
Definition: QRoundProgressBar.h:93
QString format() const
Returns the string used to generate the current text.
Definition: QRoundProgressBar.h:153
void setValue(double val)
Sets a value which will be shown on the widget.
Definition: QRoundProgressBar.cpp:69
double minimum() const
Returns minimum of the allowed value range.
Definition: QRoundProgressBar.h:175
Donut style (filled torus around the text)
Definition: QRoundProgressBar.h:89
void setFormat(const QString &format)
Defines the string used to generate the current text. If no format is set, no text will be shown...
Definition: QRoundProgressBar.cpp:143
int decimals() const
Returns number of decimals to show after the comma (default is 1).
Definition: QRoundProgressBar.h:164