QProgressBar

Inheritance diagram of PySide2.QtWidgets.QProgressBar

Synopsis

Functions

Virtual functions

Slots

Signals

Detailed Description

The PySide2.QtWidgets.QProgressBar widget provides a horizontal or vertical progress bar.

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

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

You can specify the minimum and maximum number of steps with PySide2.QtWidgets.QProgressBar.setMinimum() and PySide2.QtWidgets.QProgressBar.setMaximum() . The current number of steps is set with PySide2.QtWidgets.QProgressBar.setValue() . The progress bar can be rewound to the beginning with PySide2.QtWidgets.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 PySide2.QtNetwork.QNetworkAccessManager to download items when they are unable to determine the size of the item being downloaded.

class PySide2.QtWidgets.QProgressBar([parent=nullptr])
Parameters:parentPySide2.QtWidgets.QWidget

Constructs a progress bar with the given parent .

By default, the minimum step value is set to 0, and the maximum to 100.

PySide2.QtWidgets.QProgressBar.Direction

Specifies the reading direction of the PySide2.QtWidgets.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 CleanLooks and Plastique draw the text. Mac, Windows and WindowsVista style do not.

PySide2.QtWidgets.QProgressBar.alignment()
Return type:PySide2.QtCore.Qt.Alignment
PySide2.QtWidgets.QProgressBar.format()
Return type:unicode
PySide2.QtWidgets.QProgressBar.initStyleOption(option)
Parameters:optionPySide2.QtWidgets.QStyleOptionProgressBar

Initialize option with the values from this PySide2.QtWidgets.QProgressBar . This method is useful for subclasses when they need a PySide2.QtWidgets.QStyleOptionProgressBar , but don’t want to fill in all the information themselves.

PySide2.QtWidgets.QProgressBar.invertedAppearance()
Return type:PySide2.QtCore.bool
PySide2.QtWidgets.QProgressBar.isTextVisible()
Return type:PySide2.QtCore.bool
PySide2.QtWidgets.QProgressBar.maximum()
Return type:PySide2.QtCore.int
PySide2.QtWidgets.QProgressBar.minimum()
Return type:PySide2.QtCore.int
PySide2.QtWidgets.QProgressBar.orientation()
Return type:PySide2.QtCore.Qt.Orientation
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)
Parameters:alignmentPySide2.QtCore.Qt.Alignment
PySide2.QtWidgets.QProgressBar.setFormat(format)
Parameters:format – unicode
PySide2.QtWidgets.QProgressBar.setInvertedAppearance(invert)
Parameters:invertPySide2.QtCore.bool
PySide2.QtWidgets.QProgressBar.setMaximum(maximum)
Parameters:maximumPySide2.QtCore.int
PySide2.QtWidgets.QProgressBar.setMinimum(minimum)
Parameters:minimumPySide2.QtCore.int
PySide2.QtWidgets.QProgressBar.setOrientation(arg__1)
Parameters:arg__1PySide2.QtCore.Qt.Orientation
PySide2.QtWidgets.QProgressBar.setRange(minimum, maximum)
Parameters:
  • minimumPySide2.QtCore.int
  • maximumPySide2.QtCore.int

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 PySide2.QtWidgets.QProgressBar.reset() .

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

PySide2.QtWidgets.QProgressBar.setTextDirection(textDirection)
Parameters:textDirectionPySide2.QtWidgets.QProgressBar.Direction
PySide2.QtWidgets.QProgressBar.setTextVisible(visible)
Parameters:visiblePySide2.QtCore.bool
PySide2.QtWidgets.QProgressBar.setValue(value)
Parameters:valuePySide2.QtCore.int
PySide2.QtWidgets.QProgressBar.text()
Return type:unicode
PySide2.QtWidgets.QProgressBar.textDirection()
Return type:PySide2.QtWidgets.QProgressBar.Direction
PySide2.QtWidgets.QProgressBar.value()
Return type:PySide2.QtCore.int
PySide2.QtWidgets.QProgressBar.valueChanged(value)
Parameters:valuePySide2.QtCore.int