QxtProgressLabel Class Reference
[QxtGui module]

A label showing progress related time values. More...

 #include <QxtProgressLabel>

Inherits QLabel.

Properties

Public Functions

Public Slots


Detailed Description

QxtProgressLabel is a label widget able to show elapsed and remaining time of a progress. Usage is as simple as connecting signal QProgressBar::valueChanged() to slot QxtProgressLabel::setValue().

Example usage:

QProgressBar* bar = new QProgressBar(this);
QxtProgressLabel* label = new QxtProgressLabel(this);
connect(bar, SIGNAL(valueChanged(int)), label, SLOT(setValue(int)));

QxtProgressLabel in action.
QxtProgressLabel in action.

Member Documentation

QString contentFormat

This property holds the content format of the progress label.

The content of the label is formatted according to this property. The default value is an empty string which defaults to "ETA: %r".

The following variables may be used in the format string:

Variable

Output

%e

elapsed time

%r

remaining time

see See also: timeFormat

Access Functions:




QString timeFormat

This property holds the time format of the progress label.

Time values are formatted according to this property. The default value is an empty string which defaults to "mm:ss".

see See also: contentFormat, QTime::toString()

Access Functions:




int updateInterval

This property holds the update interval of the progress label.

The content of the progress label is updated according to this interval. A negative interval makes the content to update only during value changes. The default value is -1.

Access Functions:




explicit QxtProgressLabel ( QWidget * parent = 0 , Qt::WindowFlags flags = 0 )

Constructs a new QxtProgressLabel with parent and flags.




explicit QxtProgressLabel ( const QString & text , QWidget * parent = 0 , Qt::WindowFlags flags = 0 )

Constructs a new QxtProgressLabel with text, parent and flags.




virtual ~QxtProgressLabel ( )

Destructs the progress label.




void setValue ( int value )

Sets the current value to value.

note Note: Calling this slot by hand has no effect. Connect this slot to QProgressBar::valueChange().




void refresh ( )

Refreshes the content.




void restart ( )

Restarts the calculation of elapsed and remaining times.






Copyright © 2007 Qxt Foundation Trademarks
Qt Extension Library 0.5