class KProgress

A Progress indicator widget. More...

Definition#include <kprogress.h>
InheritsQFrame, QRangeControl
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Slots

Signals

Protected Methods


Detailed Description

Stylized progress bar.

KProgress is derived from QFrame and QRangeControl, so you can use all the methods from those classes. The only difference is that setValue(int) is now made a slot, so you can connect stuff to it.

None of the constructors take line step and page step as arguments, so by default they're set to 1 and 10 respectively.

The Blocked style ignores the textEnabled() setting and displays no text, since it looks truly ugly (and for other reasons). Signal percentageChanged(int) is emitted whenever the value changes so you can set up a different widget to display the current percentage complete and connect the signal to it.

enum Orientation {Horizontal, Vertical }

Possible values for orientation.

enum BarStyle {Solid, Blocked }

Possible values for bar style.

Solid means one continuous progress bar, Blocked means a progress bar made up of several blocks.

KProgress (QWidget *parent=0, const char *name=0)

Construct a default KProgress bar. Orientation is horizontal.

KProgress (Orientation, QWidget *parent=0, const char *name=0)

Construct a KProgress bar with an orientation.

KProgress (int minValue, int maxValue, int value, Orientation, QWidget *parent=0, const char *name=0)

Construct a KProgress bar with minimum, maximum and initial values.

~KProgress ()

Destructor

void setBarStyle (BarStyle style)

Set the progress bar style.

Allowed values are Solid and Blocked.

void setBarColor (const QColor &)

Set the color of the progress bar.

void setBarPixmap (const QPixmap &)

Set a pixmap to be shown in the progress bar.

void setOrientation (Orientation)

Set the orientation of the progress bar. Allowed values are Horizonzal and Vertical.

void setTextEnabled (bool)

If this is set to true, the progress text will be displayed.

BarStyle barStyle ()
[const]

Retrieve the bar style.

const QColor & barColor ()
[const]

Retrieve the bar color.

const QPixmap * barPixmap ()
[const]

Retrieve the bar pixmap.

Orientation orientation ()
[const]

Retrieve the orientation.

bool textEnabled ()
[const]

Returns: true if progress text will be displayed, false otherwise.

QSize sizeHint ()
[const virtual]

Retrieve the recommended width for vertical progress bars or the recommended height for horizontal progress bars

void setFormat (const QString & format)

Set the format of the text to use to display status.

The default format is "%p%" (which looks like "42%".)

Parameters:
format%p is replaced by percentage done, %v is replaced by actual value, %m is replaced by the maximum value.

QString format ()
[const]

Returns: The current format for printing status text.

void setValue (int)
[slot]

Set the current value of the progress bar (0%-100%).

void advance (int prog)
[slot]

Advance the progress bar by prog.

void percentageChanged (int)
[signal]

Emitted when the state of the progress bar changes.