Eneboo - Documentación para desarrolladores
|
The QProgressBar widget provides a horizontal progress bar. Más...
#include <qprogressbar.h>
Slots públicos | |
void | reset () |
virtual void | setTotalSteps (int totalSteps) |
virtual void | setProgress (int progress) |
void | setProgress (int progress, int totalSteps) |
void | reset () |
virtual void | setTotalSteps (int totalSteps) |
virtual void | setProgress (int progress) |
void | setProgress (int progress, int totalSteps) |
Métodos públicos | |
QProgressBar (QWidget *parent=0, const char *name=0, WFlags f=0) | |
QProgressBar (int totalSteps, QWidget *parent=0, const char *name=0, WFlags f=0) | |
int | totalSteps () const |
int | progress () const |
const QString & | progressString () const |
QSize | sizeHint () const |
QSize | minimumSizeHint () const |
void | setCenterIndicator (bool on) |
bool | centerIndicator () const |
void | setIndicatorFollowsStyle (bool) |
bool | indicatorFollowsStyle () const |
bool | percentageVisible () const |
void | setPercentageVisible (bool) |
void | show () |
QProgressBar (QWidget *parent=0, const char *name=0, WFlags f=0) | |
QProgressBar (int totalSteps, QWidget *parent=0, const char *name=0, WFlags f=0) | |
int | totalSteps () const |
int | progress () const |
const QString & | progressString () const |
QSize | sizeHint () const |
QSize | minimumSizeHint () const |
void | setCenterIndicator (bool on) |
bool | centerIndicator () const |
void | setIndicatorFollowsStyle (bool) |
bool | indicatorFollowsStyle () const |
bool | percentageVisible () const |
void | setPercentageVisible (bool) |
void | show () |
Métodos protegidos | |
void | drawContents (QPainter *) |
virtual bool | setIndicator (QString &progress_str, int progress, int totalSteps) |
void | styleChange (QStyle &) |
void | drawContents (QPainter *) |
virtual bool | setIndicator (QString &progress_str, int progress, int totalSteps) |
void | styleChange (QStyle &) |
Propiedades | |
int | totalSteps |
The total number of steps. | |
int | progress |
The current amount of progress. | |
QString | progressString |
the amount of progress as a string | |
bool | centerIndicator |
whether the indicator string should be centered | |
bool | indicatorFollowsStyle |
whether the display of the indicator string should follow the GUI style | |
bool | percentageVisible |
whether the current progress value is displayed |
The QProgressBar widget provides a horizontal progress bar.
A progress bar is used to give the user an indication of the progress of an operation and to reassure them that the application is still running.
The progress bar uses the concept of steps; you give it the total number of steps and the number of steps completed so far and it will display the percentage of steps that have been completed. You can specify the total number of steps in the constructor or later with setTotalSteps(). The current number of steps is set with setProgress(). The progress bar can be rewound to the beginning with reset().
If the total is given as 0 the progress bar shows a busy indicator instead of a percentage of steps. This is useful, for example, when using QFtp or QHttp to download items when they are unable to determine the size of the item being downloaded.
Constructs a progress bar.
The total number of steps is set to 100 by default.
The parent, name and widget flags, f, are passed on to the QFrame::QFrame() constructor.
QProgressBar::QProgressBar | ( | int | totalSteps, |
QWidget * | parent = 0 , |
||
const char * | name = 0 , |
||
WFlags | f = 0 |
||
) |
Constructs a progress bar.
The totalSteps is the total number of steps that need to be completed for the operation which this progress bar represents. For example, if the operation is to examine 50 files, this value would be 50. Before examining the first file, call setProgress(0); call setProgress(50) after examining the last file.
The parent, name and widget flags, f, are passed to the QFrame::QFrame() constructor.
QProgressBar::QProgressBar | ( | int | totalSteps, |
QWidget * | parent = 0 , |
||
const char * | name = 0 , |
||
WFlags | f = 0 |
||
) |
bool QProgressBar::centerIndicator | ( | ) | const |
bool QProgressBar::centerIndicator | ( | ) | const |
void QProgressBar::drawContents | ( | QPainter * | ) | [protected, virtual] |
Virtual function that draws the contents of the frame.
The QPainter is already open when you get it, and you must leave it open. Painter transformations are switched off on entry. If you transform the painter, remember to take the frame into account and reset transformation before returning.
This function is reimplemented by subclasses that draw something inside the frame. It should only draw inside contentsRect(). The default function does nothing.
Reimplementado de QFrame.
bool QProgressBar::indicatorFollowsStyle | ( | ) | const |
bool QProgressBar::indicatorFollowsStyle | ( | ) | const |
bool QProgressBar::percentageVisible | ( | ) | const |
bool QProgressBar::percentageVisible | ( | ) | const |
int QProgressBar::progress | ( | ) | const |
int QProgressBar::progress | ( | ) | const |
const QString& QProgressBar::progressString | ( | ) | const |
const QString& QProgressBar::progressString | ( | ) | const |
void QProgressBar::reset | ( | ) | [slot] |
void QProgressBar::reset | ( | void | ) | [slot] |
Reset the progress bar. The progress bar "rewinds" and shows no progress.
void QProgressBar::setCenterIndicator | ( | bool | on | ) |
void QProgressBar::setCenterIndicator | ( | bool | on | ) |
virtual bool QProgressBar::setIndicator | ( | QString & | progress_str, |
int | progress, | ||
int | totalSteps | ||
) | [protected, virtual] |
bool QProgressBar::setIndicator | ( | QString & | indicator, |
int | progress, | ||
int | totalSteps | ||
) | [protected, virtual] |
This method is called to generate the text displayed in the center (or in some styles, to the left) of the progress bar.
The progress may be negative, indicating that the progress bar is in the "reset" state before any progress is set.
The default implementation is the percentage of completion or blank in the reset state. The percentage is calculated based on the progress and totalSteps. You can set the indicator text if you wish.
To allow efficient repainting of the progress bar, this method should return FALSE if the string is unchanged from the last call to this function.
void QProgressBar::setIndicatorFollowsStyle | ( | bool | on | ) |
void QProgressBar::setIndicatorFollowsStyle | ( | bool | ) |
void QProgressBar::setPercentageVisible | ( | bool | on | ) |
void QProgressBar::setPercentageVisible | ( | bool | ) |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the amount of progress to progress and the total number of steps to totalSteps.
virtual void QProgressBar::setProgress | ( | int | progress | ) | [virtual, slot] |
void QProgressBar::setProgress | ( | int | progress | ) | [virtual, slot] |
void QProgressBar::setTotalSteps | ( | int | totalSteps | ) | [virtual, slot] |
virtual void QProgressBar::setTotalSteps | ( | int | totalSteps | ) | [virtual, slot] |
void QProgressBar::show | ( | ) | [virtual] |
Shows the widget and its child widgets.
If its size or position has changed, Qt guarantees that a widget gets move and resize events just before it is shown.
You almost never have to reimplement this function. If you need to change some settings before a widget is shown, use showEvent() instead. If you need to do some delayed initialization use polish().
Reimplementado de QWidget.
void QProgressBar::show | ( | ) | [virtual] |
Reimplementado de QWidget.
int QProgressBar::totalSteps | ( | ) | const |
int QProgressBar::totalSteps | ( | ) | const |
bool QProgressBar::centerIndicator [inline, read, write] |
whether the indicator string should be centered
Changing this property sets QProgressBar::indicatorFollowsStyle to FALSE. The default is TRUE.
bool QProgressBar::indicatorFollowsStyle [inline, read, write] |
whether the display of the indicator string should follow the GUI style
The default is TRUE.
bool QProgressBar::percentageVisible [inline, read, write] |
whether the current progress value is displayed
The default is TRUE.
int QProgressBar::progress [inline, read, write] |
The current amount of progress.
This property is -1 if progress counting has not started.
const QString & QProgressBar::progressString [inline, read] |
the amount of progress as a string
This property is QString::null if progress counting has not started.
int QProgressBar::totalSteps [inline, read, write] |
The total number of steps.
If totalSteps is 0, the progress bar will display a busy indicator.