The PySide.QtGui.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 ( PySide.QtGui.QProgressBar.value() - PySide.QtGui.QProgressBar.minimum() ) divided by PySide.QtGui.QProgressBar.maximum() - PySide.QtGui.QProgressBar.minimum() .
You can specify the minimum and maximum number of steps with 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.
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. See also
PySide.QtGui.QProgressDialog GUI Design Handbook: Progress Indicator
Parameters: | parent – PySide.QtGui.QWidget |
---|
Constructs a progress bar with the given parent .
By default, the minimum step value is set to 0, and the maximum to 100.
See also
Specifies the reading direction of the PySide.QtGui.QProgressBar.text() for vertical progress bars.
Constant | Description |
---|---|
QProgressBar.TopToBottom | The text is rotated 90 degrees clockwise. |
QProgressBar.BottomToTop | 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.
Return type: | PySide.QtCore.Qt.Alignment |
---|
This property holds the alignment of the progress bar.
Return type: | unicode |
---|
This property holds the string used to generate the current text.
%p - is replaced by the percentage completed. %v - is replaced by the current value. %m - is replaced by the total number of steps.
The default value is “%p%”.
See also
Parameters: | option – PySide.QtGui.QStyleOptionProgressBar |
---|
Initialize option with the values from this PySide.QtGui.QProgressBar . This method is useful for subclasses when they need a 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 .
See also
Return type: | 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.
Return type: | 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).
Return type: | PySide.QtCore.int |
---|
This property holds the progress bar’s maximum value.
When setting this property, the PySide.QtGui.QProgressBar.minimum() is adjusted if necessary to ensure that the range remains valid. If the current value falls outside the new range, the progress bar is reset with PySide.QtGui.QProgressBar.reset() .
Return type: | PySide.QtCore.int |
---|
This property holds the progress bar’s minimum value.
When setting this property, the PySide.QtGui.QProgressBar.maximum() is adjusted if necessary to ensure that the range remains valid. If the current value falls outside the new range, the progress bar is reset with PySide.QtGui.QProgressBar.reset() .
Return type: | PySide.QtCore.Qt.Orientation |
---|
This property holds the orientation of the progress bar.
The orientation must be Qt.Horizontal (the default) or Qt.Vertical .
Reset the progress bar. The progress bar “rewinds” and shows no progress.
Parameters: | alignment – PySide.QtCore.Qt.Alignment |
---|
This property holds the alignment of the progress bar.
Parameters: | format – unicode |
---|
This property holds the string used to generate the current text.
%p - is replaced by the percentage completed. %v - is replaced by the current value. %m - is replaced by the total number of steps.
The default value is “%p%”.
See also
Parameters: | 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.
Parameters: | maximum – PySide.QtCore.int |
---|
This property holds the progress bar’s maximum value.
When setting this property, the PySide.QtGui.QProgressBar.minimum() is adjusted if necessary to ensure that the range remains valid. If the current value falls outside the new range, the progress bar is reset with PySide.QtGui.QProgressBar.reset() .
Parameters: | minimum – PySide.QtCore.int |
---|
This property holds the progress bar’s minimum value.
When setting this property, the PySide.QtGui.QProgressBar.maximum() is adjusted if necessary to ensure that the range remains valid. If the current value falls outside the new range, the progress bar is reset with PySide.QtGui.QProgressBar.reset() .
Parameters: | arg__1 – PySide.QtCore.Qt.Orientation |
---|
This property holds the orientation of the progress bar.
The orientation must be Qt.Horizontal (the default) or Qt.Vertical .
Parameters: |
|
---|
Sets the progress bar’s minimum and maximum values to minimum and maximum respectively.
If maximum is smaller than minimum , minimum becomes the only legal value.
If the current value falls outside the new range, the progress bar is reset with PySide.QtGui.QProgressBar.reset() .
Parameters: | textDirection – PySide.QtGui.QProgressBar.Direction |
---|
This property holds the reading direction of the PySide.QtGui.QProgressBar.text() for vertical progress bars.
This property has no impact on horizontal progress bars. By default, the reading direction is QProgressBar.TopToBottom .
See also
PySide.QtGui.QProgressBar.orientation() textVisible()
Parameters: | 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).
Parameters: | value – PySide.QtCore.int |
---|
This property holds the progress bar’s current value.
Attempting to change the current value to one outside the minimum-maximum range has no effect on the current value.
Return type: | unicode |
---|
This property holds the descriptive text shown with the progress bar.
The text returned is the same as the text displayed in the center (or in some styles, to the left) of 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.
In the default implementation, the text either contains a percentage value that indicates the progress so far, or it is blank because the progress bar is in the reset state.
Return type: | PySide.QtGui.QProgressBar.Direction |
---|
This property holds the reading direction of the PySide.QtGui.QProgressBar.text() for vertical progress bars.
This property has no impact on horizontal progress bars. By default, the reading direction is QProgressBar.TopToBottom .
See also
PySide.QtGui.QProgressBar.orientation() textVisible()
Return type: | PySide.QtCore.int |
---|
This property holds the progress bar’s current value.
Attempting to change the current value to one outside the minimum-maximum range has no effect on the current value.
Parameters: | value – PySide.QtCore.int |
---|