AsyncProgressDialog
Classes | Public Types | Public Slots | Public Member Functions | List of all members
APD::ProgressEstimate Class Reference

A widget capable of showing elapsed and remaining time. More...

Inheritance diagram for APD::ProgressEstimate:
APD::ProgressWidget

Classes

class  Impl
 

Public Types

enum  TimeFormat { Approximate, Exact }
 

Public Slots

void setValue (int value, const QVariant &, const TimeStamp &timeStamp) override
 
void setRange (int minimum, int maximum) override
 
- Public Slots inherited from APD::ProgressWidget
virtual void setValue (int, const QVariant &, const TimeStamp &)
 
virtual void setRange (int, int)
 
virtual void setText (const QString &)
 

Public Member Functions

 ProgressEstimate (QWidget *parent=nullptr)
 
QString remainingTimeText () const
 
void setRemainingTimeText (const QString &text)
 
bool isRemainingTimeHidden () const
 
void setRemainingTimeHidden (bool hide)
 
TimeFormat remainingTimeFormat () const
 
void setRemainingTimeFormat (TimeFormat format) const
 
QString elapsedTimeText () const
 
void setElapsedTimeText (const QString &text)
 
bool isElapsedTimeHidden () const
 
void setElapsedTimeHidden (bool hide)
 
TimeFormat elapsedTimeFormat () const
 
void setElapsedTimeFormat (TimeFormat format) const
 
- Public Member Functions inherited from APD::ProgressWidget
 ProgressWidget (QWidget *parent=nullptr)
 

Detailed Description

A widget capable of showing elapsed and remaining time.

The widget calculates elapsed and remaining time based on progress range and current progress value. Note that both times can be shown after the second update to progress value as the time is measured from the first call to setValue().

Elapsed and remaining time can be shown or hidden by calling setElapsedTimeHidden() and setRemainingTimeHidden() respectively.

The reporting of elapsed and remaining time can be either exact or approximate. TimeFormat::Exact shows time in HH:MM:SS format whereas TimeFormat::Approximate format depends on the time itself (e.g. Less than 30 seconds). Default format for elapsed time is TimeFormat::Exact and for remaining time it is TimeFormat::Approximate.

Member Enumeration Documentation

◆ TimeFormat

Specifies how the elapsed and remaining time should be displayed.

Enumerator
Approximate 

The time is shown in an approximate format, e.g. Less than 30 seconds

Exact 

The time is shown in HH:MM:SS format

Constructor & Destructor Documentation

◆ ProgressEstimate()

APD::ProgressEstimate::ProgressEstimate ( QWidget *  parent = nullptr)
explicit

Constructs a progress estimate widget with the given parent.

Member Function Documentation

◆ elapsedTimeFormat()

ProgressEstimate::TimeFormat APD::ProgressEstimate::elapsedTimeFormat ( ) const

Return format of elapsed time.

The default is TimeFormat::Exact

See also
setElapsedTimeFormat(), TimeFormat

◆ elapsedTimeText()

QString APD::ProgressEstimate::elapsedTimeText ( ) const

Return label for elapsed time.

The default is "Elapsed time".

See also
setElapsedTimeText()

◆ isElapsedTimeHidden()

bool APD::ProgressEstimate::isElapsedTimeHidden ( ) const

Return flag whether the elapsed time should be displayed.

The default is false.

See also
setElapsedTimeHidden()

◆ isRemainingTimeHidden()

bool APD::ProgressEstimate::isRemainingTimeHidden ( ) const

Returns the flag whether the remaining time estimate should be displayed.

The default is false.

See also
setRemainingTimeHidden()

◆ remainingTimeFormat()

ProgressEstimate::TimeFormat APD::ProgressEstimate::remainingTimeFormat ( ) const

Return format of remaining time estimate.

The default is TimeFormat::Approximate

See also
setRemainingTimeFormat(), TimeFormat

◆ remainingTimeText()

QString APD::ProgressEstimate::remainingTimeText ( ) const

Return label for the remaining time estimate.

The default is "Estimated remaining time".

See also
setRemainingTimeText()

◆ setElapsedTimeFormat()

void APD::ProgressEstimate::setElapsedTimeFormat ( ProgressEstimate::TimeFormat  format) const

Set format of elapsed time.

See also
elapsedTimeFormat(), TimeFormat

◆ setElapsedTimeHidden()

void APD::ProgressEstimate::setElapsedTimeHidden ( bool  hide)

Set flag whether the elapsed time should be displayed.

See also
isElapsedTimeHidden()

◆ setElapsedTimeText()

void APD::ProgressEstimate::setElapsedTimeText ( const QString &  text)

Set label for elapsed time.

See also
elapsedTimeText()

◆ setRange

void APD::ProgressEstimate::setRange ( int  minimum,
int  maximum 
)
overrideslot

Reimplementation of ProgressWidget::setRange()

◆ setRemainingTimeFormat()

void APD::ProgressEstimate::setRemainingTimeFormat ( ProgressEstimate::TimeFormat  format) const

Set format of remaining time estimate.

See also
remainingTimeFormat(), TimeFormat

◆ setRemainingTimeHidden()

void APD::ProgressEstimate::setRemainingTimeHidden ( bool  hide)

Set the flag whether the remaining time estimate should be displayed.

See also
isRemainingTimeHidden()

◆ setRemainingTimeText()

void APD::ProgressEstimate::setRemainingTimeText ( const QString &  text)

Set label for the remaining time estimate.

See also
remainingTimeText()

◆ setValue

void APD::ProgressEstimate::setValue ( int  value,
const QVariant &  ,
const TimeStamp &  timeStamp 
)
overrideslot

Reimplementation of ProgressWidget::setValue()


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