Qt:Документация 4.3.2/q3progressbar

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] Q3ProgressBar Class Reference
[ Qt3Support module]

The Q3ProgressBar widget provides a horizontal progress bar. Далее...

 #include <Q3ProgressBar>

This class is part of the Qt 3 support library. It is provided to keep old source code working. Мы настоятельно не рекомендуем использовать этот класс в новом коде. See Porting to Qt 4 for more information.

Inherits QFrame.

[править] Свойства

  • 6 свойств, унаследованных от QFrame
  • 56 свойств, унаследованных от QWidget
  • 1 свойство, унаследованное от QObject

[править] Открытые функции

  • 13 открытых функций, унаследованных от QFrame
  • 201 свойство, унаследованное от QWidget
  • 29 открытых функций, унаследованных от QObject
  • 12 открытых функций, унаследованных от QPaintDevice

[править] Открытые слоты

  • 19 открытых слотов, унаследованных от QWidget
  • 1 открытый слот, унаследованный от QObject

[править] Защищенные функции

  • virtual bool setIndicator ( QString & indicator, int progress, int totalSteps )
  • 38 защищенных функций, унаследованных от QWidget
  • 7 защищенных функций, унаследованных от QObject
  • 1 защищенная функция, унаследованных от QPaintDevice

[править] Дополнительные унаследованные члены

  • 1 сигнал, унаследованный от QWidget
  • 1 сигнал, унаследованный от QObject
  • 4 статических открытых члена, унаследованных от QWidget
  • 5 статических открытых членов, унаследованных от QObject
  • 1 защищенный слот, унаследованый от QWidget

[править] Подробное описание

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.

Файл:Qprogbar-m.png Файл:Qprogbar-w.png

See also QProgressDialog and QProgressDialog.


[править] Описание cвойств

[править]
centerIndicator : bool

This property holds whether the indicator string should be centered.

Функции доступа:

  • bool centerIndicator () const
  • void setCenterIndicator ( bool on )

[править]
percentageVisible : bool

This property holds whether the current progress value is displayed.

The default is true.

Функции доступа:

  • bool percentageVisible () const
  • void setPercentageVisible ( bool )

See also centerIndicator.

[править]
progress : int

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 )

[править]
progressString : const QString

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

[править]
totalSteps : int

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 )

[править] Описание функций-членов

[править]
Q3ProgressBar::Q3ProgressBar ( QWidget * parent = 0, Qt::WindowFlags f = 0 )

Constructs a progress bar.

The total number of steps is set to 100 by default.

The parent, and widget flags, f, are passed on to the QFrame::QFrame() constructor.

See also setTotalSteps().

[править]
Q3ProgressBar::Q3ProgressBar ( int totalSteps, QWidget * parent = 0, Qt::WindowFlags 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, and widget flags, f, are passed to the QFrame::QFrame() constructor.

See also setTotalSteps() and setProgress().

[править]
int Q3ProgressBar::margin () const

Returns the with of the the margin around the contents of the widget.

This function uses QWidget::getContentsMargins() to get the margin.

Эта функция была введена в Qt 4.2.

See also setMargin() and QWidget::getContentsMargins().

[править]
void Q3ProgressBar::reset () [slot]

Reset the progress bar. The progress bar "rewinds" and shows no progress.

[править]
bool Q3ProgressBar::setIndicator ( QString & indicator, int progress, int totalSteps ) [virtual protected]

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 Q3ProgressBar::setMargin ( int margin )

Sets the width of the margin around the contents of the widget to margin.

This function uses QWidget::setContentsMargins() to set the margin.

Эта функция была введена в Qt 4.2.

See also margin() and QWidget::setContentsMargins().



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2