• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames

KGameProgress Class Reference

#include <kgameprogress.h>

Inheritance diagram for KGameProgress:

Inheritance graph
[legend]

List of all members.


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.

Author:
Martynas Kunigelis

Definition at line 49 of file kgameprogress.h.


Public Types

enum  BarStyle { Solid, Blocked }

Public Slots

void setFormat (const QString &format)
void setValue (int value)
void setMinimum (int value)
void setMaximum (int value)
void advance (int prog)
void valueChange (int newValue)

Signals

void percentageChanged (int)

Public Member Functions

 KGameProgress (QWidget *parent=0)
 KGameProgress (Qt::Orientation orient, QWidget *parent=0)
 ~KGameProgress ()
void setBarStyle (BarStyle style)
void setBarColor (const QColor &)
void setBarPixmap (const QPixmap &)
void setOrientation (Qt::Orientation)
void setTextEnabled (bool)
BarStyle barStyle () const
QColor barColor () const
const QPixmap * barPixmap () const
int value () const
int minimum () const
int maximum () const
Qt::Orientation orientation () const
bool textEnabled () const
virtual QSize sizeHint () const
virtual QSize minimumSizeHint () const
virtual QSizePolicy sizePolicy () const
QString format () const

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

Member Enumeration Documentation

enum KGameProgress::BarStyle

Possible values for bar style.

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

Enumerator:
Solid 
Blocked 

Definition at line 69 of file kgameprogress.h.


Constructor & Destructor Documentation

KGameProgress::KGameProgress ( QWidget *  parent = 0  )  [explicit]

Construct a horizontal progress bar.

Definition at line 63 of file kgameprogress.cpp.

KGameProgress::KGameProgress ( Qt::Orientation  orient,
QWidget *  parent = 0 
) [explicit]

Construct a progress bar with orientation orient.

Definition at line 70 of file kgameprogress.cpp.

KGameProgress::~KGameProgress (  ) 

Destruct the progress bar.

Definition at line 77 of file kgameprogress.cpp.


Member Function Documentation

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::setBarColor ( const QColor &  color  ) 

Set the color of the progress bar.

Definition at line 129 of file kgameprogress.cpp.

void KGameProgress::setBarPixmap ( const QPixmap &  pixmap  ) 

Set a pixmap to be shown in the progress bar.

Definition at line 119 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.

BarStyle KGameProgress::barStyle (  )  const

Retrieve the bar style.

See also:
setBarStyle()

QColor KGameProgress::barColor (  )  const

Retrieve the bar color.

See also:
setBarColor()

const QPixmap* KGameProgress::barPixmap (  )  const

Retrieve the bar pixmap.

See also:
setBarPixmap()

int KGameProgress::value (  )  const

Retrive the current status.

See also:
setValue()

int KGameProgress::minimum (  )  const

Retrieve the minimum value.

See also:
setMinimum()

Definition at line 190 of file kgameprogress.cpp.

int KGameProgress::maximum (  )  const

Retrieve the maximum value.

See also:
setMaximum()

Qt::Orientation KGameProgress::orientation (  )  const

Retrive the orientation of the progress bar.

See also:
setOrientation()

bool KGameProgress::textEnabled (  )  const

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

See also:
setFormat()

QSize KGameProgress::sizeHint (  )  const [virtual]

Definition at line 205 of file kgameprogress.cpp.

QSize KGameProgress::minimumSizeHint (  )  const [virtual]

Definition at line 218 of file kgameprogress.cpp.

QSizePolicy KGameProgress::sizePolicy (  )  const [virtual]

Definition at line 223 of file kgameprogress.cpp.

QString KGameProgress::format (  )  const

Retrieve the current format for printing status text.

See also:
setFormat()

Definition at line 395 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::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.

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::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::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.

void KGameProgress::valueChange ( int  newValue  )  [slot]

Definition at line 248 of file kgameprogress.cpp.

void KGameProgress::percentageChanged ( int   )  [signal]

Emitted when the state of the progress bar changes.

void KGameProgress::styleChange ( QStyle &   )  [protected]

Definition at line 256 of file kgameprogress.cpp.

void KGameProgress::paletteChange ( const QPalette &  p  )  [protected]

Definition at line 277 of file kgameprogress.cpp.

void KGameProgress::paintEvent ( QPaintEvent *  e  )  [protected]

Definition at line 308 of file kgameprogress.cpp.


Property Documentation

int KGameProgress::value [read, write]

Definition at line 53 of file kgameprogress.h.

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.

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.


The documentation for this class was generated from the following files:
  • kgameprogress.h
  • kgameprogress.cpp

libkdegames

Skip menu "libkdegames"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal