Q3ProgressBar Class Reference
|
|
|
Q3ProgressBar ( QWidget * parent = 0, Qt::WindowFlags f = 0 ) | |
Q3ProgressBar ( int totalSteps, QWidget * parent = 0, Qt::WindowFlags f = 0 ) | |
bool | centerIndicator () const |
int | margin () const |
bool | percentageVisible () const |
int | progress () const |
const QString & | progressString () const |
void | setCenterIndicator ( bool on ) |
void | setMargin ( int margin ) |
void | setPercentageVisible ( bool ) |
int | totalSteps () const |
virtual QSize | minimumSizeHint () const |
virtual void | setVisible ( bool visible ) |
virtual QSize | sizeHint () const |
void | reset () |
virtual void | setProgress ( int progress ) |
void | setProgress ( int progress, int totalSteps ) |
virtual void | setTotalSteps ( int totalSteps ) |
virtual bool | setIndicator ( QString & indicator, int progress, int totalSteps ) |
virtual void | changeEvent ( QEvent * ev ) |
virtual void | paintEvent ( QPaintEvent * ) |
The Q3ProgressBar 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.
See also QProgressDialog and QProgressDialog.
This property holds whether the indicator string should be centered.
Функции доступа:
bool | centerIndicator () const |
void | setCenterIndicator ( bool on ) |
This property holds whether the current progress value is displayed.
Значение по умолчанию - true.
Функции доступа:
bool | percentageVisible () const |
void | setPercentageVisible ( bool ) |
See also centerIndicator.
This property holds the current amount of progress.
This property is -1 if progress counting has not started.
Функции доступа:
int | progress () const |
virtual void | setProgress ( int progress ) |
void | setProgress ( int progress, int totalSteps ) |
This property holds the amount of progress as a string.
This property is an empty string if progress counting has not started.
Функции доступа:
const QString & | progressString () const |
This property holds the total number of steps.
If totalSteps is 0, the progress bar will display a busy indicator.
Функции доступа:
int | totalSteps () const |
virtual void | setTotalSteps ( int totalSteps ) |
Создаём индикатор выполнения.
Общее количество шагов по умолчанию установлено равным 100.
The parent, and widget flags, f, are passed on to the QFrame::QFrame() constructor.
Смотрите также setTotalSteps().
Создаём индикатор выполнения.
totalSteps - общее количество шагов, которые необходимы для завершения операции, которая представлена в индикаторе выполнения. Например, если операция заключается в проверке 50 файлов, то это значение будет равно 50. Перед проверкой первого файла, вызываем setProgress(0); вызываем setProgress(50) после проверки последнего файла.
The parent, and widget flags, f, are passed to the QFrame::QFrame() constructor.
Смотрите также setTotalSteps() и setProgress().
Переопределено от QWidget::changeEvent().
Возвращает ширину полей вокруг содержимого виджета.
This function uses QWidget::getContentsMargins() to get the margin.
Эта функция была введена в Qt 4.2.
Смотрите также setMargin() и QWidget::getContentsMargins().
Переопределено от QWidget::minimumSizeHint().
Переопределено от QWidget::paintEvent().
Reset the progress bar. The progress bar "rewinds" and shows no progress.
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.
Присваивает ширине полей вокруг содержимого виджета значение margin.
This function uses QWidget::setContentsMargins() to set the margin.
Эта функция была введена в Qt 4.2.
Смотрите также margin() и QWidget::setContentsMargins().
Переопределено из QWidget::setVisible().
Переопределено от QWidget::sizeHint().
Авторские права © 2010 Nokia Corporation и/или её дочерние компании | Торговые марки | Qt 4.6.4 |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |