class KProgress

A progress indicator widget. More...

Definition#include <kprogress.h>
InheritsQFrame (qt) [public ], QRangeControl (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Slots

Signals


Detailed Description

A 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() is now made a slot, so you can connect stuff to it.

Details

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() 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 BarStyle { Solid, Blocked }

BarStyle

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)

KProgress

Construct a horizontal progress bar.

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

KProgress

Construct a progress bar with orientation orient.

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

KProgress

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

 ~KProgress ()

~KProgress

Destruct the progress bar.

void  setBarStyle (BarStyle style)

setBarStyle

Set the progress bar style.

Allowed values are Solid and Blocked.

void  setBarColor (const QColor &)

setBarColor

Set the color of the progress bar.

void  setBarPixmap (const QPixmap &)

setBarPixmap

Set a pixmap to be shown in the progress bar.

void  setOrientation (Orientation)

setOrientation

Set the orientation of the progress bar.

Allowed values are Horizontal and Vertical.

void  setTextEnabled (bool)

setTextEnabled

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

BarStyle  barStyle ()

barStyle

[const]

Retrieve the bar style.

See also: setBarStyle()

const QColorbarColor ()

barColor

[const]

Retrieve the bar color.

See also: setBarColor()

const QPixmapbarPixmap ()

barPixmap

[const]

Retrieve the bar pixmap.

See also: setBarPixmap()

Orientation  orientation ()

orientation

[const]

Retrive the orientation of the progress bar.

See also: setOrientation()

bool  textEnabled ()

textEnabled

[const]

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

See also: setFormat()

QSize  sizeHint ()

sizeHint

[const virtual]

Reimplemented from QFrame for internal purposes..

QSizePolicy  sizePolicy ()

sizePolicy

[const virtual]

Reimplemented from QFrame for internal purposes..

void  setFormat (const QString & format)

setFormat

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 ()

format

[const]

Retrieve the current format for printing status text.

See also: setFormat()

void  setValue (int value)

setValue

[slot]

Set the current value of the progress bar to value.

This must be a number in the range 0..100.

Reimplemented from QRangeControl.

void  advance (int prog)

advance

[slot]

Advance the progress bar by prog.

This method is provided for convenience and is equivalent with setValue(value()+prog).

void  percentageChanged (int)

percentageChanged

[signal]

Emitted when the state of the progress bar changes.

void  valueChange ()

valueChange

[protected]

Reimplemented from QRangeControl for internal purposes..

void  rangeChange ()

rangeChange

[protected]

Reimplemented from QRangeControl for internal purposes..

void  styleChange ( QStyle& )

styleChange

[protected]

void  paletteChange ( const QPalette & )

paletteChange

[protected]

void  drawContents ( QPainter * )

drawContents

[protected]

Reimplemented from QFrame for internal purposes..