• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QRadioButton

    下一话题

    QDialog

    QProgressBar

    概要

    函数

    虚函数

    信号

    详细描述

    PySide.QtGui.QProgressBar widget provides a horizontal or vertical progress bar.

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

    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 ( PySide.QtGui.QProgressBar.value() - PySide.QtGui.QProgressBar.minimum() ) divided by PySide.QtGui.QProgressBar.maximum() - PySide.QtGui.QProgressBar.minimum() .

    可以指定最小 最大步进数采用 PySide.QtGui.QProgressBar.setMinimum() and setMaximum. The current number of steps is set with PySide.QtGui.QProgressBar.setValue() . The progress bar can be rewound to the beginning with PySide.QtGui.QProgressBar.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 PySide.QtNetwork.QFtp or PySide.QtNetwork.QNetworkAccessManager to download items when they are unable to determine the size of the item being downloaded.

    ../../_images/macintosh-progressbar.png A progress bar shown in the Macintosh widget style.
    ../../_images/windowsxp-progressbar.png A progress bar shown in the Windows XP widget style.
    ../../_images/plastique-progressbar.png A progress bar shown in the Plastique widget style.

    另请参阅

    PySide.QtGui.QProgressDialog GUI 设计手册:进度指示器

    class PySide.QtGui. QProgressBar ( [ parent=None ] )
    参数: parent PySide.QtGui.QWidget

    构造进度条采用给定 parent .

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

    PySide.QtGui.QProgressBar. Direction

    指定阅读方向为 PySide.QtGui.QProgressBar.text() 为垂直进度条。

    常量 描述
    QProgressBar.TopToBottom 文本被顺时针旋转 90 度。
    QProgressBar.BottomToTop 文本被逆时针旋转 90 度。

    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.

    PySide.QtGui.QProgressBar. alignment ( )
    返回类型: PySide.QtCore.Qt.Alignment

    This property holds the alignment of the progress bar.

    PySide.QtGui.QProgressBar. format ( )
    返回类型: unicode

    This property holds the string used to generate the current text.

    %p - 由完成百分比替换。%v - 由当前值替换。%m - 由总步数替换。

    The default value is “%p%”.

    PySide.QtGui.QProgressBar. initStyleOption ( option )
    参数: option PySide.QtGui.QStyleOptionProgressBar

    初始化 option 采用值来自此 PySide.QtGui.QProgressBar 。此方法对子类是有用的,当需要 PySide.QtGui.QStyleOptionProgressBar or PySide.QtGui.QStyleOptionProgressBarV2 , but don't want to fill in all the information themselves. This function will check the version of the PySide.QtGui.QStyleOptionProgressBar and fill in the additional values for a PySide.QtGui.QStyleOptionProgressBarV2 .

    PySide.QtGui.QProgressBar. invertedAppearance ( )
    返回类型: PySide.QtCore.bool

    This property holds whether or not a progress bar shows its progress inverted.

    If this property is false, the progress bar grows in the other direction (e.g. from right to left). By default, the progress bar is not inverted.

    PySide.QtGui.QProgressBar. isTextVisible ( )
    返回类型: PySide.QtCore.bool

    This property holds whether the current completed percentage should be displayed.

    This property may be ignored by the style (e.g., PySide.QtGui.QMacStyle never draws the text).

    PySide.QtGui.QProgressBar. maximum ( )
    返回类型: PySide.QtCore.int

    This property holds the progress bar's maximum value.

    当设置此特性时, PySide.QtGui.QProgressBar.minimum() 被调整,若有必要确保范围仍然有效。若当前值落在新范围之外,进度条被重置采用 PySide.QtGui.QProgressBar.reset() .

    PySide.QtGui.QProgressBar. minimum ( )
    返回类型: PySide.QtCore.int

    This property holds the progress bar's minimum value.

    当设置此特性时, PySide.QtGui.QProgressBar.maximum() 被调整,若有必要确保范围仍然有效。若当前值落在新范围之外,进度条被重置采用 PySide.QtGui.QProgressBar.reset() .

    PySide.QtGui.QProgressBar. orientation ( )
    返回类型: PySide.QtCore.Qt.Orientation

    This property holds the orientation of the progress bar.

    取向必须是 Qt.Horizontal (默认) 或 Qt.Vertical .

    PySide.QtGui.QProgressBar. reset ( )

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

    PySide.QtGui.QProgressBar. setAlignment ( alignment )
    参数: alignment PySide.QtCore.Qt.Alignment

    This property holds the alignment of the progress bar.

    PySide.QtGui.QProgressBar. setFormat ( format )
    参数: format – unicode

    This property holds the string used to generate the current text.

    %p - 由完成百分比替换。%v - 由当前值替换。%m - 由总步数替换。

    The default value is “%p%”.

    PySide.QtGui.QProgressBar. setInvertedAppearance ( invert )
    参数: invert PySide.QtCore.bool

    This property holds whether or not a progress bar shows its progress inverted.

    If this property is false, the progress bar grows in the other direction (e.g. from right to left). By default, the progress bar is not inverted.

    PySide.QtGui.QProgressBar. setMaximum ( maximum )
    参数: maximum PySide.QtCore.int

    This property holds the progress bar's maximum value.

    当设置此特性时, PySide.QtGui.QProgressBar.minimum() 被调整,若有必要确保范围仍然有效。若当前值落在新范围之外,进度条被重置采用 PySide.QtGui.QProgressBar.reset() .

    PySide.QtGui.QProgressBar. setMinimum ( minimum )
    参数: minimum PySide.QtCore.int

    This property holds the progress bar's minimum value.

    当设置此特性时, PySide.QtGui.QProgressBar.maximum() 被调整,若有必要确保范围仍然有效。若当前值落在新范围之外,进度条被重置采用 PySide.QtGui.QProgressBar.reset() .

    PySide.QtGui.QProgressBar. setOrientation ( arg__1 )
    参数: arg__1 PySide.QtCore.Qt.Orientation

    This property holds the orientation of the progress bar.

    取向必须是 Qt.Horizontal (默认) 或 Qt.Vertical .

    PySide.QtGui.QProgressBar. setRange ( minimum , maximum )
    参数:
    • minimum PySide.QtCore.int
    • maximum PySide.QtCore.int

    把进度条的最小和最大值设为 minimum and maximum 分别。

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

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

    PySide.QtGui.QProgressBar. setTextDirection ( textDirection )
    参数: textDirection PySide.QtGui.QProgressBar.Direction

    此特性保持阅读方向为 PySide.QtGui.QProgressBar.text() 为垂直进度条。

    此特性对水平进度条没有影响。默认情况下,读取方向为 QProgressBar.TopToBottom .

    PySide.QtGui.QProgressBar. setTextVisible ( visible )
    参数: visible PySide.QtCore.bool

    This property holds whether the current completed percentage should be displayed.

    This property may be ignored by the style (e.g., PySide.QtGui.QMacStyle never draws the text).

    PySide.QtGui.QProgressBar. setValue ( value )
    参数: value PySide.QtCore.int

    This property holds the progress bar's current value.

    试图把当前值更改为最小-最大范围之外的某一值,不影响当前值。

    PySide.QtGui.QProgressBar. text ( )
    返回类型: unicode

    This property holds the descriptive text shown with the progress bar.

    返回文本同进度条居中 (或某些风格左侧) 显示文本。

    The progress shown in the text may be smaller than the minimum value, indicating that the progress bar is in the “reset” state before any progress is set.

    在默认实现中,文本包含指示到目前为止的进度百分比值,或为空 (因为进度条处于重置状态)。

    PySide.QtGui.QProgressBar. textDirection ( )
    返回类型: PySide.QtGui.QProgressBar.Direction

    此特性保持阅读方向为 PySide.QtGui.QProgressBar.text() 为垂直进度条。

    此特性对水平进度条没有影响。默认情况下,读取方向为 QProgressBar.TopToBottom .

    PySide.QtGui.QProgressBar. value ( )
    返回类型: PySide.QtCore.int

    This property holds the progress bar's current value.

    试图把当前值更改为最小-最大范围之外的某一值,不影响当前值。

    PySide.QtGui.QProgressBar. valueChanged ( value )
    参数: value PySide.QtCore.int