#include <kgameprogress.h>

Public Types | |
| enum | BarStyle { Solid, Blocked } |
| Possible values for bar style. More... | |
Public Slots | |
| void | setFormat (const QString &format) |
| Set the format of the text to use to display status. | |
| void | setValue (int value) |
Set the current value of the progress bar to value. | |
| void | setMinimum (int value) |
Set the minimum value of the progress bar to value. | |
| void | setMaximum (int value) |
Set the maximum value of the progress bar to value. | |
| void | advance (int prog) |
Advance the progress bar by prog. | |
| void | valueChange (int newValue) |
Signals | |
| void | percentageChanged (int) |
| Emitted when the state of the progress bar changes. | |
Public Member Functions | |
| KGameProgress (QWidget *parent=0) | |
| Construct a horizontal progress bar. | |
| KGameProgress (Qt::Orientation orient, QWidget *parent=0) | |
Construct a progress bar with orientation orient. | |
| ~KGameProgress () | |
| Destruct the progress bar. | |
| void | setBarStyle (BarStyle style) |
| Set the progress bar style. | |
| 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 (Qt::Orientation) |
| Set the orientation of the progress bar. | |
| void | setTextEnabled (bool) |
If this is set to true, the progress text will be displayed. | |
| BarStyle | barStyle () const |
| Retrieve the bar style. | |
| QColor | barColor () const |
| Retrieve the bar color. | |
| const QPixmap * | barPixmap () const |
| Retrieve the bar pixmap. | |
| int | value () const |
| Retrive the current status. | |
| int | minimum () const |
| Retrieve the minimum value. | |
| int | maximum () const |
| Retrieve the maximum value. | |
| Qt::Orientation | orientation () const |
| Retrive the orientation of the progress bar. | |
| bool | textEnabled () const |
Returns true if progress text will be displayed, false otherwise. | |
| virtual QSize | sizeHint () const |
| virtual QSize | minimumSizeHint () const |
| virtual QSizePolicy | sizePolicy () const |
| QString | format () const |
| Retrieve the current format for printing status text. | |
Protected Member Functions | |
| void | styleChange (QStyle &) |
| void | paletteChange (const QPalette &) |
| void | paintEvent (QPaintEvent *e) |
Properties | |
| int | value |
| int | mininum |
| int | maximum |
| BarStyle | barStyle |
| QColor | barColor |
| QPixmap | barPixmap |
| Qt::Orientation | orientation |
| bool | textEnabled |
Classes | |
| class | KGameProgressPrivate |
| KGameProgress -- a progress indicator widget for KDE. More... | |
KGameProgress 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.
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.
Definition at line 49 of file kgameprogress.h.
Possible values for bar style.
Solid means one continuous progress bar, Blocked means a progress bar made up of several blocks.
Definition at line 69 of file kgameprogress.h.
| KGameProgress::KGameProgress | ( | QWidget * | parent = 0 |
) | [explicit] |
Construct a horizontal progress bar.
Definition at line 63 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::initialize(), and KGameProgress::KGameProgressPrivate::slider.

| KGameProgress::KGameProgress | ( | Qt::Orientation | orient, | |
| QWidget * | parent = 0 | |||
| ) | [explicit] |
Construct a progress bar with orientation orient.
Definition at line 70 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::initialize(), and KGameProgress::KGameProgressPrivate::slider.

| KGameProgress::~KGameProgress | ( | ) |
Destruct the progress bar.
Definition at line 77 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::bar_pixmap.
| void KGameProgress::setBarStyle | ( | BarStyle | style | ) |
Set the progress bar style.
Allowed values are Solid and Blocked.
Definition at line 139 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::bar_style.
| void KGameProgress::setBarColor | ( | const QColor & | color | ) |
Set the color of the progress bar.
Definition at line 129 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::bar_color, KGameProgress::KGameProgressPrivate::bar_pixmap, and KGameProgress::KGameProgressPrivate::use_supplied_bar_color.
| void KGameProgress::setBarPixmap | ( | const QPixmap & | pixmap | ) |
Set a pixmap to be shown in the progress bar.
Definition at line 119 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::bar_pixmap.
| void KGameProgress::setOrientation | ( | Qt::Orientation | orientation | ) |
Set the orientation of the progress bar.
Allowed values are Horizontal and Vertical.
Definition at line 147 of file kgameprogress.cpp.
| void KGameProgress::setTextEnabled | ( | bool | enable | ) |
If this is set to true, the progress text will be displayed.
Definition at line 170 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::text_enabled.
| BarStyle KGameProgress::barStyle | ( | ) | const |
| QColor KGameProgress::barColor | ( | ) | const |
| const QPixmap* KGameProgress::barPixmap | ( | ) | const |
| int KGameProgress::value | ( | ) | const |
| int KGameProgress::minimum | ( | ) | const |
Retrieve the minimum value.
Definition at line 190 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::slider.
Referenced by KGameProgress::KGameProgressPrivate::recalcValue().
| int KGameProgress::maximum | ( | ) | const |
| Qt::Orientation KGameProgress::orientation | ( | ) | const |
Retrive the orientation of the progress bar.
Referenced by paintEvent(), sizeHint(), and sizePolicy().
| bool KGameProgress::textEnabled | ( | ) | const |
| QSize KGameProgress::sizeHint | ( | ) | const [virtual] |
Definition at line 205 of file kgameprogress.cpp.
References orientation().
Referenced by minimumSizeHint().

| QSize KGameProgress::minimumSizeHint | ( | ) | const [virtual] |
Definition at line 218 of file kgameprogress.cpp.
References sizeHint().

| QSizePolicy KGameProgress::sizePolicy | ( | ) | const [virtual] |
Definition at line 223 of file kgameprogress.cpp.
References orientation().

| QString KGameProgress::format | ( | ) | const |
Retrieve the current format for printing status text.
Definition at line 395 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::format_.
| void KGameProgress::setFormat | ( | const QString & | format | ) | [slot] |
Set the format of the text to use to display status.
The default format is "%p%" (which looks like "42%".)
| format | p is replaced by percentage done, v is replaced by actual value, m is replaced by the maximum value. |
Definition at line 390 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::format_.
| void KGameProgress::setValue | ( | int | value | ) | [slot] |
Set the current value of the progress bar to value.
This must be a number in the range 0..100.
Definition at line 155 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::slider.
Referenced by advance().
| void KGameProgress::setMinimum | ( | int | value | ) | [slot] |
Set the minimum value of the progress bar to value.
The maximum value may be changed to keep the range valid.
Definition at line 160 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::slider.
| void KGameProgress::setMaximum | ( | int | value | ) | [slot] |
Set the maximum value of the progress bar to value.
The minimum value may be changed to keep the range valid.
Definition at line 165 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::slider.
| void KGameProgress::advance | ( | int | prog | ) | [slot] |
Advance the progress bar by prog.
This method is provided for convenience and is equivalent with setValue(value()+prog).
Definition at line 83 of file kgameprogress.cpp.
References setValue(), and value().
| void KGameProgress::valueChange | ( | int | newValue | ) | [slot] |
Definition at line 248 of file kgameprogress.cpp.
References percentageChanged(), and KGameProgress::KGameProgressPrivate::recalcValue().
Referenced by KGameProgress::KGameProgressPrivate::initialize().
| void KGameProgress::percentageChanged | ( | int | ) | [signal] |
| void KGameProgress::styleChange | ( | QStyle & | ) | [protected] |
Definition at line 256 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::adjustStyle().

| void KGameProgress::paletteChange | ( | const QPalette & | p | ) | [protected] |
Definition at line 277 of file kgameprogress.cpp.
References paletteChange().
Referenced by KGameProgress::KGameProgressPrivate::initialize(), and paletteChange().

| void KGameProgress::paintEvent | ( | QPaintEvent * | e | ) | [protected] |
Definition at line 308 of file kgameprogress.cpp.
References KGameProgress::KGameProgressPrivate::bar_color, KGameProgress::KGameProgressPrivate::bar_pixmap, KGameProgress::KGameProgressPrivate::bar_style, Blocked, KGameProgress::KGameProgressPrivate::drawText(), KGameProgress::KGameProgressPrivate::fr, orientation(), KGameProgress::KGameProgressPrivate::recalcValue(), Solid, and KGameProgress::KGameProgressPrivate::text_enabled.

int KGameProgress::value [read, write] |
Definition at line 53 of file kgameprogress.h.
Referenced by KGameProgress::KGameProgressPrivate::drawText(), and KGameProgress::KGameProgressPrivate::recalcValue().
int KGameProgress::mininum [read, write] |
Definition at line 54 of file kgameprogress.h.
int KGameProgress::maximum [read, write] |
Definition at line 55 of file kgameprogress.h.
Referenced by KGameProgress::KGameProgressPrivate::drawText(), and KGameProgress::KGameProgressPrivate::recalcValue().
KGameProgress::BarStyle KGameProgress::barStyle [read, write] |
Definition at line 56 of file kgameprogress.h.
QColor KGameProgress::barColor [read, write] |
Definition at line 57 of file kgameprogress.h.
const QPixmap * KGameProgress::barPixmap [read, write] |
Definition at line 58 of file kgameprogress.h.
Qt::Orientation KGameProgress::orientation [read, write] |
Definition at line 59 of file kgameprogress.h.
bool KGameProgress::textEnabled [read, write] |
Definition at line 60 of file kgameprogress.h.
1.5.3