JKQtExtras
a library of useful Qt widgets and tools
JKQTEModernProgressWidget Class Reference

a modern progress indicator widget More...

#include <jkqtemodernprogress.h>

Inheritance diagram for JKQTEModernProgressWidget:
Collaboration diagram for JKQTEModernProgressWidget:

Public Types

enum  InnerProgressIndicatorMode {
  NoInnerIndicator,
  InnerProgressBarHorizontal,
  InnerProgressFillVertical,
  InnerProgressFillHorizontal
}
 mode of percentage display More...
 
enum  Mode {
  Strokes,
  Circles,
  Ring,
  GradientRing,
  RoundedStrokeRing,
  Pie
}
 modes of the progress widget More...
 
enum  TextDisplayMode {
  NoText,
  PercentText,
  ValueText
}
 mode of percentage display More...
 

Public Slots

void setBackgroundColor (QColor col)
 color of an indicator, when inactive (usually a bit darker than the widget background color) More...
 
void setIndicatorBackgroundColor (QColor col)
 background color behind the indicator items More...
 
void setIndicatorColor (QColor col)
 color of the current item More...
 
void setInnerCircleBackgroundColor (QColor col)
 backround color of the inner circle More...
 
void setInnerCircleProgressColor (QColor col)
 backround color of the inner circle progress indicator More...
 
void setInnerProgressIndicatorMode (InnerProgressIndicatorMode innerProgressMode)
 type of inner progress indicator More...
 
void setInnerRadius (int val)
 inner radius (0..1) of the displayed circle/stroke ring More...
 
void setItems (int i)
 number of indicators making up the circle More...
 
void setMaximum (double val)
 range maximum More...
 
void setMinimum (double val)
 range minimum More...
 
void setMode (Mode m)
 type of widget: display a ring of strokes or circles, ...) More...
 
void setNonBackgroundRange (double val)
 how many of the indicators (fraction 0..1 of items() ) should follow current indicator with a different color than backgroundColor() ) More...
 
void setOuterRadius (int val)
 outer radius (0..1) of the displayed circle/stroke ring More...
 
void setPrecision (int p)
 precision for progress display More...
 
void setRange (double min, double max)
 set range of progress More...
 
void setSpin (bool enabled)
 is an automatic spin going on? More...
 
void setSpinInterval (int msec)
 interval (milliseconds) of the movement if spin() is true More...
 
void setStartColor (QColor col)
 color of the indicator the furthest away from the main indicator (usually the same as backgroundColor() ) More...
 
void setStopColor (QColor col)
 color just before the current indicator (usually darker than startColor() ) More...
 
void setSuffix (QString s)
 suffix for progress display More...
 
void setTextColor (QColor col)
 color of the progress text More...
 
void setTextDisplayMode (TextDisplayMode m)
 type of text display mode More...
 
void setValue (double val)
 progress value More...
 

Public Member Functions

 JKQTEModernProgressWidget (QWidget *parent=NULL)
 
virtual ~JKQTEModernProgressWidget ()
 
QColor indicatorBackgroundColor () const
 color of an indicator, when inactive (usually a bit darker than the widget background color) More...
 
QColor indicatorColor () const
 color of the current item More...
 
QColor innerCircleBackgroundColor () const
 backround color of the inner circle More...
 
QColor innerCircleProgressColor () const
 backround color of the inner circle progress indicator More...
 
InnerProgressIndicatorMode innerProgressIndicatorMode () const
 type of inner progress indicator More...
 
double innerRadius () const
 inner radius (0..1) of the displayed circle/stroke ring More...
 
int items () const
 number of indicators making up the circle More...
 
double maximum () const
 range maximum More...
 
double minimum () const
 range minimum More...
 
Mode mode () const
 type of widget: display a ring of strokes or circles, ...) More...
 
double nonBackgroundRange () const
 how many of the indicators (fraction 0..1 of items() ) should follow current indicator with a different color than backgroundColor() ) More...
 
double outerRadius () const
 outer radius (0..1) of the displayed circle/stroke ring More...
 
int precision () const
 precision for progress display More...
 
bool spin () const
 is an automatic spin going on? More...
 
int spinInterval () const
 interval (milliseconds) of the movement if spin() is true More...
 
QColor startColor () const
 color of the indicator the furthest away from the main indicator (usually the same as backgroundColor() ) More...
 
QColor stopColor () const
 color just before the current indicator (usually darker than startColor() ) More...
 
QString suffix () const
 suffix for progress display More...
 
QColor textColor () const
 color of the progress text More...
 
TextDisplayMode textDisplayMode () const
 type of text display mode More...
 
double value () const
 progress value More...
 

Protected Slots

void doSpin ()
 
void updateWidget ()
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 

Properties

QColor indicatorBackgroundColor
 
QColor indicatorColor
 
QColor innerCircleBackgroundColor
 
QColor innerCircleProgressColor
 
InnerProgressIndicatorMode innerProgressIndicatorMode
 
double innerRadius
 
int items
 
double maximum
 
double minimum
 
Mode mode
 
double nonBackgroundRange
 
double outerRadius
 
int precision
 
bool spin
 
int spinInterval
 
QColor startColor
 
QColor stopColor
 
QString suffix
 
TextDisplayMode textDisplayMode
 
double value
 

Static Private Member Functions

static int getSmoothItems (int items)
 

Private Attributes

bool m_darkCircleBorder
 
bool m_doRepaint
 
QColor m_indicatorBackgroundColor
 
QColor m_indicatorColor
 
QColor m_innerCircleBackgroundColor
 backround color of the inner circle More...
 
QColor m_innerCircleProgressColor
 
InnerProgressIndicatorMode m_innerProgressMode
 
double m_innerRadius
 
int m_items
 
Mode m_mode
 
double m_nonBackgroundRange
 
double m_outerRadius
 
int m_precision
 
double m_rangeMax
 
double m_rangeMin
 
int m_smoothItems
 
int m_smoothSpinItem
 
bool m_spin
 
int m_spinInterval
 
int m_spinItem
 
QColor m_startColor
 
QColor m_stopColor
 
QString m_suffix
 
QColor m_textColor
 
TextDisplayMode m_textDisplayMode
 
double m_value
 
QTimer timer
 

Detailed Description

a modern progress indicator widget

Like QProgressBar this can be used to display a progress value() between rangeMin() and rangeMax(), but there is also a mode where a colored circle/stroke wanders around the widget to indicate that something is going on, but not giving a real progress.

Usage example:

// choose a mode
// set the range (these may be any doubles)
progress->setRange(0,100);
// set the display mode of the text in the center of the widget (here: OFF)
// set the suffix for the text display (e.g. to display "25/100" when JKQTEModernProgressWidget::ValueText is used)
progress->setSuffix("/100");
// connect to a slider, so we see can change the progress for demonstration
connect(slider, &QSlider::valueChanged, progress, &JKQTEModernProgressWidget::setValue);

Member Enumeration Documentation

◆ InnerProgressIndicatorMode

mode of percentage display

Enumerator
NoInnerIndicator 

do not display a progress indicator in the center

InnerProgressBarHorizontal 

display a progress bar in the center (below the text)

InnerProgressFillVertical 

fill the center, depending on the progress, using innerCircleProgressColor() (behind the text)

InnerProgressFillHorizontal 

fill the center, depending on the progress, using innerCircleProgressColor() (behind the text)

◆ Mode

modes of the progress widget

Enumerator
Strokes 

a ring of rounded strokes

Circles 

a ring of circles

Ring 

a ring filled with a color

GradientRing 

a ring filled with a color gradient

RoundedStrokeRing 

a ring filled with a color

Pie 

a pie filled with a color

◆ TextDisplayMode

mode of percentage display

Enumerator
NoText 

do not display any text

PercentText 

display the percentage (value() between minimum() and maximum() )

ValueText 

display the value with the given suffix() (suffix() =="/100" in the example image)

Constructor & Destructor Documentation

◆ JKQTEModernProgressWidget()

JKQTEModernProgressWidget::JKQTEModernProgressWidget ( QWidget *  parent = NULL)

◆ ~JKQTEModernProgressWidget()

virtual JKQTEModernProgressWidget::~JKQTEModernProgressWidget ( )
virtual

Member Function Documentation

◆ doSpin

void JKQTEModernProgressWidget::doSpin ( )
protectedslot

◆ getSmoothItems()

static int JKQTEModernProgressWidget::getSmoothItems ( int  items)
staticprivate

◆ indicatorBackgroundColor()

QColor JKQTEModernProgressWidget::indicatorBackgroundColor ( ) const

color of an indicator, when inactive (usually a bit darker than the widget background color)

◆ indicatorColor()

QColor JKQTEModernProgressWidget::indicatorColor ( ) const

color of the current item

◆ innerCircleBackgroundColor()

QColor JKQTEModernProgressWidget::innerCircleBackgroundColor ( ) const

backround color of the inner circle

◆ innerCircleProgressColor()

QColor JKQTEModernProgressWidget::innerCircleProgressColor ( ) const

backround color of the inner circle progress indicator

◆ innerProgressIndicatorMode()

InnerProgressIndicatorMode JKQTEModernProgressWidget::innerProgressIndicatorMode ( ) const

type of inner progress indicator

◆ innerRadius()

double JKQTEModernProgressWidget::innerRadius ( ) const

inner radius (0..1) of the displayed circle/stroke ring

◆ items()

int JKQTEModernProgressWidget::items ( ) const

number of indicators making up the circle

◆ maximum()

double JKQTEModernProgressWidget::maximum ( ) const

range maximum

◆ minimum()

double JKQTEModernProgressWidget::minimum ( ) const

range minimum

◆ mode()

Mode JKQTEModernProgressWidget::mode ( ) const

type of widget: display a ring of strokes or circles, ...)

◆ nonBackgroundRange()

double JKQTEModernProgressWidget::nonBackgroundRange ( ) const

how many of the indicators (fraction 0..1 of items() ) should follow current indicator with a different color than backgroundColor() )

◆ outerRadius()

double JKQTEModernProgressWidget::outerRadius ( ) const

outer radius (0..1) of the displayed circle/stroke ring

◆ paintEvent()

virtual void JKQTEModernProgressWidget::paintEvent ( QPaintEvent *  event)
protectedvirtual

◆ precision()

int JKQTEModernProgressWidget::precision ( ) const

precision for progress display

◆ resizeEvent()

virtual void JKQTEModernProgressWidget::resizeEvent ( QResizeEvent *  event)
protectedvirtual

◆ setBackgroundColor

void JKQTEModernProgressWidget::setBackgroundColor ( QColor  col)
slot

color of an indicator, when inactive (usually a bit darker than the widget background color)

◆ setIndicatorBackgroundColor

void JKQTEModernProgressWidget::setIndicatorBackgroundColor ( QColor  col)
slot

background color behind the indicator items

◆ setIndicatorColor

void JKQTEModernProgressWidget::setIndicatorColor ( QColor  col)
slot

color of the current item

◆ setInnerCircleBackgroundColor

void JKQTEModernProgressWidget::setInnerCircleBackgroundColor ( QColor  col)
slot

backround color of the inner circle

◆ setInnerCircleProgressColor

void JKQTEModernProgressWidget::setInnerCircleProgressColor ( QColor  col)
slot

backround color of the inner circle progress indicator

◆ setInnerProgressIndicatorMode

void JKQTEModernProgressWidget::setInnerProgressIndicatorMode ( InnerProgressIndicatorMode  innerProgressMode)
slot

type of inner progress indicator

◆ setInnerRadius

void JKQTEModernProgressWidget::setInnerRadius ( int  val)
slot

inner radius (0..1) of the displayed circle/stroke ring

◆ setItems

void JKQTEModernProgressWidget::setItems ( int  i)
slot

number of indicators making up the circle

◆ setMaximum

void JKQTEModernProgressWidget::setMaximum ( double  val)
slot

range maximum

◆ setMinimum

void JKQTEModernProgressWidget::setMinimum ( double  val)
slot

range minimum

◆ setMode

void JKQTEModernProgressWidget::setMode ( Mode  m)
slot

type of widget: display a ring of strokes or circles, ...)

◆ setNonBackgroundRange

void JKQTEModernProgressWidget::setNonBackgroundRange ( double  val)
slot

how many of the indicators (fraction 0..1 of items() ) should follow current indicator with a different color than backgroundColor() )

◆ setOuterRadius

void JKQTEModernProgressWidget::setOuterRadius ( int  val)
slot

outer radius (0..1) of the displayed circle/stroke ring

◆ setPrecision

void JKQTEModernProgressWidget::setPrecision ( int  p)
slot

precision for progress display

◆ setRange

void JKQTEModernProgressWidget::setRange ( double  min,
double  max 
)
slot

set range of progress

◆ setSpin

void JKQTEModernProgressWidget::setSpin ( bool  enabled)
slot

is an automatic spin going on?

◆ setSpinInterval

void JKQTEModernProgressWidget::setSpinInterval ( int  msec)
slot

interval (milliseconds) of the movement if spin() is true

◆ setStartColor

void JKQTEModernProgressWidget::setStartColor ( QColor  col)
slot

color of the indicator the furthest away from the main indicator (usually the same as backgroundColor() )

◆ setStopColor

void JKQTEModernProgressWidget::setStopColor ( QColor  col)
slot

color just before the current indicator (usually darker than startColor() )

◆ setSuffix

void JKQTEModernProgressWidget::setSuffix ( QString  s)
slot

suffix for progress display

◆ setTextColor

void JKQTEModernProgressWidget::setTextColor ( QColor  col)
slot

color of the progress text

◆ setTextDisplayMode

void JKQTEModernProgressWidget::setTextDisplayMode ( TextDisplayMode  m)
slot

type of text display mode

◆ setValue

void JKQTEModernProgressWidget::setValue ( double  val)
slot

progress value

◆ spin()

bool JKQTEModernProgressWidget::spin ( ) const

is an automatic spin going on?

◆ spinInterval()

int JKQTEModernProgressWidget::spinInterval ( ) const

interval (milliseconds) of the movement if spin() is true

◆ startColor()

QColor JKQTEModernProgressWidget::startColor ( ) const

color of the indicator the furthest away from the main indicator (usually the same as backgroundColor() )

◆ stopColor()

QColor JKQTEModernProgressWidget::stopColor ( ) const

color just before the current indicator (usually darker than startColor() )

◆ suffix()

QString JKQTEModernProgressWidget::suffix ( ) const

suffix for progress display

◆ textColor()

QColor JKQTEModernProgressWidget::textColor ( ) const

color of the progress text

◆ textDisplayMode()

TextDisplayMode JKQTEModernProgressWidget::textDisplayMode ( ) const

type of text display mode

◆ updateWidget

void JKQTEModernProgressWidget::updateWidget ( )
protectedslot

◆ value()

double JKQTEModernProgressWidget::value ( ) const

progress value

Member Data Documentation

◆ m_darkCircleBorder

bool JKQTEModernProgressWidget::m_darkCircleBorder
private

◆ m_doRepaint

bool JKQTEModernProgressWidget::m_doRepaint
private

◆ m_indicatorBackgroundColor

QColor JKQTEModernProgressWidget::m_indicatorBackgroundColor
private

◆ m_indicatorColor

QColor JKQTEModernProgressWidget::m_indicatorColor
private

◆ m_innerCircleBackgroundColor

QColor JKQTEModernProgressWidget::m_innerCircleBackgroundColor
private

backround color of the inner circle

◆ m_innerCircleProgressColor

QColor JKQTEModernProgressWidget::m_innerCircleProgressColor
private

◆ m_innerProgressMode

InnerProgressIndicatorMode JKQTEModernProgressWidget::m_innerProgressMode
private

◆ m_innerRadius

double JKQTEModernProgressWidget::m_innerRadius
private

◆ m_items

int JKQTEModernProgressWidget::m_items
private

◆ m_mode

Mode JKQTEModernProgressWidget::m_mode
private

◆ m_nonBackgroundRange

double JKQTEModernProgressWidget::m_nonBackgroundRange
private

◆ m_outerRadius

double JKQTEModernProgressWidget::m_outerRadius
private

◆ m_precision

int JKQTEModernProgressWidget::m_precision
private

◆ m_rangeMax

double JKQTEModernProgressWidget::m_rangeMax
private

◆ m_rangeMin

double JKQTEModernProgressWidget::m_rangeMin
private

◆ m_smoothItems

int JKQTEModernProgressWidget::m_smoothItems
private

◆ m_smoothSpinItem

int JKQTEModernProgressWidget::m_smoothSpinItem
private

◆ m_spin

bool JKQTEModernProgressWidget::m_spin
private

◆ m_spinInterval

int JKQTEModernProgressWidget::m_spinInterval
private

◆ m_spinItem

int JKQTEModernProgressWidget::m_spinItem
private

◆ m_startColor

QColor JKQTEModernProgressWidget::m_startColor
private

◆ m_stopColor

QColor JKQTEModernProgressWidget::m_stopColor
private

◆ m_suffix

QString JKQTEModernProgressWidget::m_suffix
private

◆ m_textColor

QColor JKQTEModernProgressWidget::m_textColor
private

◆ m_textDisplayMode

TextDisplayMode JKQTEModernProgressWidget::m_textDisplayMode
private

◆ m_value

double JKQTEModernProgressWidget::m_value
private

◆ timer

QTimer JKQTEModernProgressWidget::timer
private

Property Documentation

◆ indicatorBackgroundColor

QColor JKQTEModernProgressWidget::indicatorBackgroundColor
readwrite

◆ indicatorColor

QColor JKQTEModernProgressWidget::indicatorColor
readwrite

◆ innerCircleBackgroundColor

QColor JKQTEModernProgressWidget::innerCircleBackgroundColor
readwrite

◆ innerCircleProgressColor

QColor JKQTEModernProgressWidget::innerCircleProgressColor
readwrite

◆ innerProgressIndicatorMode

InnerProgressIndicatorMode JKQTEModernProgressWidget::innerProgressIndicatorMode
readwrite

◆ innerRadius

double JKQTEModernProgressWidget::innerRadius
readwrite

◆ items

int JKQTEModernProgressWidget::items
readwrite

◆ maximum

double JKQTEModernProgressWidget::maximum
readwrite

◆ minimum

double JKQTEModernProgressWidget::minimum
readwrite

◆ mode

Mode JKQTEModernProgressWidget::mode
readwrite

◆ nonBackgroundRange

double JKQTEModernProgressWidget::nonBackgroundRange
readwrite

◆ outerRadius

double JKQTEModernProgressWidget::outerRadius
readwrite

◆ precision

int JKQTEModernProgressWidget::precision
readwrite

◆ spin

bool JKQTEModernProgressWidget::spin
readwrite

◆ spinInterval

int JKQTEModernProgressWidget::spinInterval
readwrite

◆ startColor

QColor JKQTEModernProgressWidget::startColor
readwrite

◆ stopColor

QColor JKQTEModernProgressWidget::stopColor
readwrite

◆ suffix

QString JKQTEModernProgressWidget::suffix
readwrite

◆ textDisplayMode

TextDisplayMode JKQTEModernProgressWidget::textDisplayMode
readwrite

◆ value

double JKQTEModernProgressWidget::value
readwrite

The documentation for this class was generated from the following file:
JKQTEModernProgressWidget::NoText
@ NoText
Definition: jkqtemodernprogress.h:95
JKQTEModernProgressWidget::setValue
void setValue(double val)
progress value
JKQTEModernProgressWidget::setSuffix
void setSuffix(QString s)
suffix for progress display
JKQTEModernProgressWidget
a modern progress indicator widget
Definition: jkqtemodernprogress.h:59
JKQTEModernProgressWidget::Circles
@ Circles
Definition: jkqtemodernprogress.h:85
JKQTEModernProgressWidget::JKQTEModernProgressWidget
JKQTEModernProgressWidget(QWidget *parent=NULL)
JKQTEModernProgressWidget::setRange
void setRange(double min, double max)
set range of progress
JKQTEModernProgressWidget::setTextDisplayMode
void setTextDisplayMode(TextDisplayMode m)
type of text display mode
JKQTEModernProgressWidget::setMode
void setMode(Mode m)
type of widget: display a ring of strokes or circles, ...)