libkdegames
KGameProgress Class Reference
#include <KGameProgress>

Detailed Description
A progress indicator widget.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 51 of file kgameprogress.h.
Public Types | |
| enum | BarStyle { Solid, Blocked } |
Public Slots | |
| void | advance (int prog) |
| void | setFormat (const QString &format) |
| void | setMaximum (int value) |
| void | setMinimum (int value) |
| void | setValue (int value) |
| void | valueChange (int newValue) |
Signals | |
| void | percentageChanged (int) |
Public Member Functions | |
| QColor | barColor () const |
| const QPixmap * | barPixmap () const |
| BarStyle | barStyle () const |
| QString | format () const |
| KGameProgress (Qt::Orientation orient, QWidget *parent=0) | |
| KGameProgress (QWidget *parent=0) | |
| int | maximum () const |
| int | minimum () const |
| virtual QSize | minimumSizeHint () const |
| Qt::Orientation | orientation () const |
| void | setBarColor (const QColor &) |
| void | setBarPixmap (const QPixmap &) |
| void | setBarStyle (BarStyle style) |
| void | setOrientation (Qt::Orientation) |
| void | setTextEnabled (bool) |
| virtual QSize | sizeHint () const |
| virtual QSizePolicy | sizePolicy () const |
| bool | textEnabled () const |
| int | value () const |
| ~KGameProgress () | |
Protected Member Functions | |
| void | paintEvent (QPaintEvent *e) |
| void | paletteChange (const QPalette &) |
| void | styleChange (QStyle &) |
Properties | |
| QColor | barColor |
| QPixmap | barPixmap |
| BarStyle | barStyle |
| int | maximum |
| int | mininum |
| Qt::Orientation | orientation |
| bool | textEnabled |
| int | value |
Member Enumeration Documentation
Possible values for bar style.
Solid means one continuous progress bar, Blocked means a progress bar made up of several blocks.
Definition at line 71 of file kgameprogress.h.
Constructor & Destructor Documentation
| KGameProgress::KGameProgress | ( | QWidget * | parent = 0 |
) | [explicit] |
| KGameProgress::KGameProgress | ( | Qt::Orientation | orient, | |
| QWidget * | parent = 0 | |||
| ) | [explicit] |
| KGameProgress::~KGameProgress | ( | ) |
Member Function Documentation
| 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.
| QColor KGameProgress::barColor | ( | ) | const |
| const QPixmap* KGameProgress::barPixmap | ( | ) | const |
| BarStyle KGameProgress::barStyle | ( | ) | const |
| QString KGameProgress::format | ( | ) | const |
Retrieve the current format for printing status text.
- See also:
- setFormat()
Definition at line 395 of file kgameprogress.cpp.
| int KGameProgress::maximum | ( | ) | const |
| int KGameProgress::minimum | ( | ) | const |
| QSize KGameProgress::minimumSizeHint | ( | ) | const [virtual] |
Definition at line 218 of file kgameprogress.cpp.
| Qt::Orientation KGameProgress::orientation | ( | ) | const |
| void KGameProgress::paintEvent | ( | QPaintEvent * | e | ) | [protected] |
Definition at line 308 of file kgameprogress.cpp.
| void KGameProgress::paletteChange | ( | const QPalette & | p | ) | [protected] |
Definition at line 277 of file kgameprogress.cpp.
| void KGameProgress::percentageChanged | ( | int | ) | [signal] |
Emitted when the state of the progress bar changes.
| void KGameProgress::setBarColor | ( | const QColor & | color | ) |
| void KGameProgress::setBarPixmap | ( | const QPixmap & | 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.
| 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%".)
- Parameters:
-
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.
| 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.
| 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.
| 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.
| 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.
| QSize KGameProgress::sizeHint | ( | ) | const [virtual] |
Definition at line 205 of file kgameprogress.cpp.
| QSizePolicy KGameProgress::sizePolicy | ( | ) | const [virtual] |
Definition at line 223 of file kgameprogress.cpp.
| void KGameProgress::styleChange | ( | QStyle & | ) | [protected] |
Definition at line 256 of file kgameprogress.cpp.
| bool KGameProgress::textEnabled | ( | ) | const |
| int KGameProgress::value | ( | ) | const |
| void KGameProgress::valueChange | ( | int | newValue | ) | [slot] |
Definition at line 248 of file kgameprogress.cpp.
Property Documentation
QColor KGameProgress::barColor [read, write] |
Definition at line 59 of file kgameprogress.h.
const QPixmap * KGameProgress::barPixmap [read, write] |
Definition at line 60 of file kgameprogress.h.
KGameProgress::BarStyle KGameProgress::barStyle [read, write] |
Definition at line 58 of file kgameprogress.h.
int KGameProgress::maximum [read, write] |
Definition at line 57 of file kgameprogress.h.
int KGameProgress::mininum [read, write] |
Definition at line 56 of file kgameprogress.h.
Qt::Orientation KGameProgress::orientation [read, write] |
Definition at line 61 of file kgameprogress.h.
bool KGameProgress::textEnabled [read, write] |
Definition at line 62 of file kgameprogress.h.
int KGameProgress::value [read, write] |
Definition at line 55 of file kgameprogress.h.
The documentation for this class was generated from the following files:
KDE 4.1 API Reference