The QProgressBar widget provides a horizontal or vertical progress bar. 更多...
继承 QWidget .
The QProgressBar widget provides a horizontal or vertical 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 set it up by specifying the minimum and maximum possible step values, and it will display the percentage of steps that have been completed when you later give it the current step value. The percentage is calculated by dividing the progress ( value () - minimum ()) 除以 maximum () - minimum ().
可以指定最小 最大步进数采用 setMinimum () 和 setMaximum. The current number of steps is set with setValue (). The progress bar can be rewound to the beginning with reset ().
If minimum and maximum both are set to 0, the bar shows a busy indicator instead of a percentage of steps. This is useful, for example, when using QFtp or QNetworkAccessManager to download items when they are unable to determine the size of the item being downloaded.
|
A progress bar shown in the Macintosh widget style. |
|
A progress bar shown in the Windows XP widget style. |
|
A progress bar shown in the Plastique widget style. |
指定阅读方向为 text for vertical progress bars.
| 常量 | 值 | 描述 |
|---|---|---|
| QProgressBar.TopToBottom | 0 | 文本被顺时针旋转 90 度。 |
| QProgressBar.BottomToTop | 1 | The text is rotated 90 degrees counter-clockwise. |
Note that whether or not the text is drawn is dependent on the style. Currently CDE, CleanLooks, Motif, and Plastique draw the text. Mac, Windows and WindowsXP style do not.
该枚举在 Qt 4.1 引入或被修改。
另请参阅 textDirection .
parent argument, if not None, causes self to be owned by Qt instead of PyQt.
构造进度条采用给定 parent .
By default, the minimum step value is set to 0, and the maximum to 100.
另请参阅 setRange ().
重实现自 QObject.event ().
初始化 option 采用值来自此 QProgressBar . This method is useful for subclasses when they need a QStyleOptionProgressBar or QStyleOptionProgressBarV2 ,但 don't want to fill in all the information themselves. This function will check the version of the QStyleOptionProgressBar and fill in the additional values for a QStyleOptionProgressBarV2 .
另请参阅 QStyleOption.initFrom ().
重实现自 QWidget.minimumSizeHint ().
重实现自 QWidget.paintEvent ().
This method is also a Qt slot with the C++ signature void reset() .
Reset the progress bar. The progress bar "rewinds" and shows no progress.
This method is also a Qt slot with the C++ signature void setMaximum(int) .
This method is also a Qt slot with the C++ signature void setMinimum(int) .
This method is also a Qt slot with the C++ signature void setOrientation(Qt::Orientation) .
把进度条的最小和最大值设为 minimum and maximum 分别。
若 maximum 小于 minimum , minimum 变为唯一合法值。
If the current value falls outside the new range, the progress bar is reset with reset ().
This method is also a Qt slot with the C++ signature void setValue(int) .
重实现自 QWidget.sizeHint ().
This is the default overload of this signal.
This signal is emitted when the value shown in the progress bar 改变。 value is the new value shown by the progress bar.