QRoundProgressBar  0.1.b
Qt circular progress bar widget
 All Classes Functions Enumerations Enumerator Pages
Public Types | Public Slots | Public Member Functions | List of all members
QRoundProgressBar Class Reference

The QRoundProgressBar class represents a circular progress bar and maintains its API similar to the QProgressBar. More...

#include <QRoundProgressBar.h>

Inheritance diagram for QRoundProgressBar:

Public Types

enum  BarStyle { StyleDonut, StylePie, StyleLine }
 The BarStyle enum defines general look of the progress bar. More...
 

Public Slots

void setRange (double min, double max)
 Defines minimum und maximum of the allowed value range. If the current value does not fit into the range, it will be automatically adjusted. More...
 
void setMinimum (double min)
 Defines minimum of the allowed value range. If the current value does not fit into the range, it will be automatically adjusted. More...
 
void setMaximum (double max)
 Defines maximum of the allowed value range. If the current value does not fit into the range, it will be automatically adjusted. More...
 
void setValue (double val)
 Sets a value which will be shown on the widget. More...
 
void setValue (int val)
 Integer version of the previous slot. More...
 

Public Member Functions

double nullPosition () const
 Return position (in degrees) of minimum value. More...
 
void setNullPosition (double position)
 Defines position of minimum value. More...
 
void setBarStyle (BarStyle style)
 Sets visual style of the widget. More...
 
BarStyle barStyle () const
 Returns current progree bar style. More...
 
void setOutlinePenWidth (double penWidth)
 Sets width of the outline circle pen. More...
 
double outlinePenWidth () const
 Returns width of the outline circle pen.
 
void setDataPenWidth (double penWidth)
 Sets width of the data circle pen. More...
 
double dataPenWidth () const
 Returns width of the data circle pen.
 
void setDataColors (const QGradientStops &stopPoints)
 Sets colors of the visible data and makes gradient brush from them. Gradient colors can be set for Donut and Pie styles (see setBarStyle() function). More...
 
void setFormat (const QString &format)
 Defines the string used to generate the current text. If no format is set, no text will be shown. More...
 
void resetFormat ()
 Sets format string to empty string. No text will be shown therefore. See setFormat() for more information.
 
QString format () const
 Returns the string used to generate the current text.
 
void setDecimals (int count)
 Sets number of decimals to show after the comma (default is 1). More...
 
int decimals () const
 Returns number of decimals to show after the comma (default is 1). More...
 
double value () const
 Returns current value shown on the widget. More...
 
double minimum () const
 Returns minimum of the allowed value range. More...
 
double maximum () const
 Returns maximum of the allowed value range. More...
 

Detailed Description

The QRoundProgressBar class represents a circular progress bar and maintains its API similar to the QProgressBar.

Styles

QRoundProgressBar currently supports Donut, Pie and Line styles. See setBarStyle() for more details.

Colors

Generally QRoundProgressBar uses its palette and font attributes to define how it will look.

The following QPalette members are considered:

Create a QPalette with given attributes and apply it via setPalette().

Color gradient

Donut and Pie styles allow to use color gradient for currernt value area instead of plain brush fill. See setDataColors() for more details.

Value text

Value text is generally drawn inside the QRoundProgressBar using its font() and QPalette::Text role from its palette().

To define pattern of the text, use setFormat() function (see Qt's QProgressBar for more details).

To define number of decimals to be shown, use setDecimals() function.

Font

To use own font for value text, apply it via setFont().

By default, font size will be adjusted automatically to fit the inner circle of the widget.

Member Enumeration Documentation

The BarStyle enum defines general look of the progress bar.

Enumerator
StyleDonut 

Donut style (filled torus around the text)

StylePie 

Pie style (filled pie segment with the text in center)

StyleLine 

Line style (thin round line around the text)

Member Function Documentation

BarStyle QRoundProgressBar::barStyle ( ) const
inline

Returns current progree bar style.

See Also
setBarStyle
int QRoundProgressBar::decimals ( ) const
inline

Returns number of decimals to show after the comma (default is 1).

See Also
setFormat, setDecimals
double QRoundProgressBar::maximum ( ) const
inline

Returns maximum of the allowed value range.

See Also
setMaximum, setRange
double QRoundProgressBar::minimum ( ) const
inline

Returns minimum of the allowed value range.

See Also
setMinimum, setRange
double QRoundProgressBar::nullPosition ( ) const
inline

Return position (in degrees) of minimum value.

See Also
setNullPosition
void QRoundProgressBar::setBarStyle ( QRoundProgressBar::BarStyle  style)

Sets visual style of the widget.

See Also
barStyle
void QRoundProgressBar::setDataColors ( const QGradientStops &  stopPoints)

Sets colors of the visible data and makes gradient brush from them. Gradient colors can be set for Donut and Pie styles (see setBarStyle() function).

Warning: this function will override widget's palette() to set dynamically created gradient brush.

Parameters
stopPointsList of colors (should have at least 2 values, see Qt's QGradientStops for more details). Color value at point 0 corresponds to the minimum() value, while color value at point 1 corresponds to the maximum(). Other colors will be distributed accordingly to the defined ranges (see setRange()).
void QRoundProgressBar::setDataPenWidth ( double  penWidth)

Sets width of the data circle pen.

Parameters
penWidthwidth of the data circle pen (in pixels)
void QRoundProgressBar::setDecimals ( int  count)

Sets number of decimals to show after the comma (default is 1).

See Also
setFormat
void QRoundProgressBar::setFormat ( const QString &  format)

Defines the string used to generate the current text. If no format is set, no text will be shown.

Parameters
formatsee QProgressBar's format description
See Also
setDecimals
void QRoundProgressBar::setMaximum ( double  max)
slot

Defines maximum of the allowed value range. If the current value does not fit into the range, it will be automatically adjusted.

Parameters
maxmaximum of the allowed value range
See Also
setRange
void QRoundProgressBar::setMinimum ( double  min)
slot

Defines minimum of the allowed value range. If the current value does not fit into the range, it will be automatically adjusted.

Parameters
minminimum of the allowed value range
See Also
setRange
void QRoundProgressBar::setNullPosition ( double  position)

Defines position of minimum value.

Parameters
positionposition on the circle (in degrees) of minimum value
See Also
nullPosition
void QRoundProgressBar::setOutlinePenWidth ( double  penWidth)

Sets width of the outline circle pen.

Parameters
penWidthwidth of the outline circle pen (in pixels)
void QRoundProgressBar::setRange ( double  min,
double  max 
)
slot

Defines minimum und maximum of the allowed value range. If the current value does not fit into the range, it will be automatically adjusted.

Parameters
minminimum of the allowed value range
maxmaximum of the allowed value range
void QRoundProgressBar::setValue ( double  val)
slot

Sets a value which will be shown on the widget.

Parameters
valmust be between minimum() and maximum()
void QRoundProgressBar::setValue ( int  val)
slot

Integer version of the previous slot.

Parameters
valmust be between minimum() and maximum()
double QRoundProgressBar::value ( ) const
inline

Returns current value shown on the widget.

See Also
setValue()

The documentation for this class was generated from the following files:

Designed by Sintegrial Technologies (c) 2015-now