内容表

上一话题

QPlainTextEdit

下一话题

QProgressDialog

QProgressBar

QProgressBar widget provides a horizontal or vertical progress bar. 更多

Inheritance diagram of PySide2.QtWidgets.QProgressBar

概要

函数

虚函数

信号

详细描述

../../_images/windows-progressbar.png

进度条被用于向用户给出操作进度指示,并安慰用户应用程序仍在运行。

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() ) divided by maximum() - minimum() .

可以指定最小 最大步进数采用 setMinimum() and setMaximum 。设置当前步进数采用 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 QNetworkAccessManager to download items when they are unable to determine the size of the item being downloaded.

class QProgressBar ( [ parent=None ] )
param parent

QWidget

构造进度条采用给定 parent .

默认情况下,最小步进值被设为 0,最大步进值被设为 100。

另请参阅

setRange()

PySide2.QtWidgets.QProgressBar. Direction

指定阅读方向为 text 为垂直进度条。

常量

描述

QProgressBar.TopToBottom

文本被顺时针旋转 90 度。

QProgressBar.BottomToTop

文本被逆时针旋转 90 度。

注意:是否绘制文本取决于风格。目前 CleanLooks 和 Plastique 风格绘制文本。Mac、Windows 及 WindowsVista 风格不绘制文本。

另请参阅

textDirection

PySide2.QtWidgets.QProgressBar. alignment ( )
返回类型

Alignment

另请参阅

setAlignment()

PySide2.QtWidgets.QProgressBar. format ( )
返回类型

unicode

另请参阅

setFormat()

PySide2.QtWidgets.QProgressBar. initStyleOption ( option )
参数

option QStyleOptionProgressBar

初始化 option 采用值来自此 QProgressBar 。此方法对子类是有用的,当需要 QStyleOptionProgressBar , but don’t want to fill in all the information themselves.

另请参阅

initFrom()

PySide2.QtWidgets.QProgressBar. invertedAppearance ( )
返回类型

bool

PySide2.QtWidgets.QProgressBar. isTextVisible ( )
返回类型

bool

PySide2.QtWidgets.QProgressBar. maximum ( )
返回类型

int

另请参阅

setMaximum()

PySide2.QtWidgets.QProgressBar. minimum ( )
返回类型

int

另请参阅

setMinimum()

PySide2.QtWidgets.QProgressBar. orientation ( )
返回类型

取向

另请参阅

setOrientation()

PySide2.QtWidgets.QProgressBar. reset ( )

Reset the progress bar. The progress bar “rewinds” and shows no progress.

PySide2.QtWidgets.QProgressBar. resetFormat ( )
PySide2.QtWidgets.QProgressBar. setAlignment ( alignment )
参数

alignment Alignment

另请参阅

alignment()

PySide2.QtWidgets.QProgressBar. setFormat ( format )
参数

format – unicode

另请参阅

format()

PySide2.QtWidgets.QProgressBar. setInvertedAppearance ( invert )
参数

invert bool

PySide2.QtWidgets.QProgressBar. setMaximum ( maximum )
参数

maximum int

另请参阅

maximum()

PySide2.QtWidgets.QProgressBar. setMinimum ( minimum )
参数

minimum int

另请参阅

minimum()

PySide2.QtWidgets.QProgressBar. setOrientation ( arg__1 )
参数

arg__1 取向

另请参阅

orientation()

PySide2.QtWidgets.QProgressBar. setRange ( minimum , maximum )
参数
  • minimum int

  • maximum int

Sets the progress bar’s minimum and maximum values to minimum and maximum 分别。

maximum 小于 minimum , minimum 变为唯一合法值。

若当前值落在新范围之外,进度条被重置采用 reset() .

QProgressBar can be set to undetermined state by using (0, 0).

另请参阅

minimum maximum

PySide2.QtWidgets.QProgressBar. setTextDirection ( textDirection )
参数

textDirection Direction

另请参阅

textDirection()

PySide2.QtWidgets.QProgressBar. setTextVisible ( visible )
参数

visible bool

另请参阅

isTextVisible()

PySide2.QtWidgets.QProgressBar. setValue ( value )
参数

value int

另请参阅

value()

PySide2.QtWidgets.QProgressBar. text ( )
返回类型

unicode

PySide2.QtWidgets.QProgressBar. textDirection ( )
返回类型

Direction

PySide2.QtWidgets.QProgressBar. value ( )
返回类型

int

另请参阅

setValue()

PySide2.QtWidgets.QProgressBar. valueChanged ( value )
参数

value int