Skip to content

ProgressBar

Qt Base Class: QProgressBar

Signature: QProgressBar(self, parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None

Base classes

Name Children Inherits
WidgetMixin
prettyqt.widgets.widget
QProgressBar
PySide6.QtWidgets
QProgressBar(self, parent: Optional[PySide6.QtWidgets.QWidget] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473296309568["widgets.ProgressBar"]
  1473293688240["widgets.WidgetMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473245548480["gui.PaintDeviceMixin"]
  1473290621296["QtWidgets.QProgressBar"]
  1473290849680["QtWidgets.QWidget"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473300082368["QtGui.QPaintDevice"]
  1473293688240 --> 1473296309568
  1473299815024 --> 1473293688240
  140713234304496 --> 1473299815024
  1473245548480 --> 1473293688240
  140713234304496 --> 1473245548480
  1473290621296 --> 1473296309568
  1473290849680 --> 1473290621296
  1473288842240 --> 1473290849680
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208
  1473300082368 --> 1473290849680
  1473291690208 --> 1473300082368

🛈 DocStrings

Bases: WidgetMixin, QProgressBar

Horizontal or vertical progress bar.

Source code in prettyqt\widgets\progressbar.py
class ProgressBar(widgets.WidgetMixin, widgets.QProgressBar):
    """Horizontal or vertical progress bar."""

    def __init__(self, *args, text_visible: bool = True, **kwargs):
        super().__init__(*args, text_visible=text_visible, **kwargs)

    def set_alignment(self, alignment: constants.AlignmentStr | constants.AlignmentFlag):
        """Set the alignment of the layout.

        Args:
            alignment: alignment for the layout
        """
        self.setAlignment(constants.ALIGNMENTS.get_enum_value(alignment))

    def get_alignment(self) -> constants.AlignmentStr:
        """Return current alignment.

        Returns:
            alignment
        """
        return constants.ALIGNMENTS.inverse[self.alignment()]

    def set_text_direction(
        self, text_direction: TextDirectionStr | widgets.QProgressBar.Direction
    ):
        """Set the text direction of the layout.

        Args:
            text_direction: text direction for the layout
        """
        self.setTextDirection(TEXT_DIRECTIONS.get_enum_value(text_direction))

    def get_text_direction(self) -> TextDirectionStr:
        """Return current text direction.

        Returns:
            Text direction
        """
        return TEXT_DIRECTIONS.inverse[self.textDirection()]

    def set_orientation(
        self, orientation: constants.OrientationStr | constants.Orientation
    ):
        """Set the orientation of the progress bar.

        Args:
            orientation: orientation for the progress bar
        """
        self.setOrientation(constants.ORIENTATION.get_enum_value(orientation))

    def get_orientation(self) -> constants.OrientationStr:
        """Return current orientation.

        Returns:
            orientation
        """
        return constants.ORIENTATION.inverse[self.orientation()]

    def set_range(self, start: int, end: int):
        self.setRange(start, end)

    def set_value(self, value: int):
        self.setValue(value)

    def get_value(self) -> int:
        return self.value()

get_alignment() -> constants.AlignmentStr

Return current alignment.

Source code in prettyqt\widgets\progressbar.py
def get_alignment(self) -> constants.AlignmentStr:
    """Return current alignment.

    Returns:
        alignment
    """
    return constants.ALIGNMENTS.inverse[self.alignment()]

get_orientation() -> constants.OrientationStr

Return current orientation.

Source code in prettyqt\widgets\progressbar.py
def get_orientation(self) -> constants.OrientationStr:
    """Return current orientation.

    Returns:
        orientation
    """
    return constants.ORIENTATION.inverse[self.orientation()]

get_text_direction() -> TextDirectionStr

Return current text direction.

Source code in prettyqt\widgets\progressbar.py
def get_text_direction(self) -> TextDirectionStr:
    """Return current text direction.

    Returns:
        Text direction
    """
    return TEXT_DIRECTIONS.inverse[self.textDirection()]

set_alignment(alignment: constants.AlignmentStr | constants.AlignmentFlag)

Set the alignment of the layout.

Parameters:

Name Type Description Default
alignment AlignmentStr | AlignmentFlag

alignment for the layout

required
Source code in prettyqt\widgets\progressbar.py
def set_alignment(self, alignment: constants.AlignmentStr | constants.AlignmentFlag):
    """Set the alignment of the layout.

    Args:
        alignment: alignment for the layout
    """
    self.setAlignment(constants.ALIGNMENTS.get_enum_value(alignment))

set_orientation(orientation: constants.OrientationStr | constants.Orientation)

Set the orientation of the progress bar.

Parameters:

Name Type Description Default
orientation OrientationStr | Orientation

orientation for the progress bar

required
Source code in prettyqt\widgets\progressbar.py
def set_orientation(
    self, orientation: constants.OrientationStr | constants.Orientation
):
    """Set the orientation of the progress bar.

    Args:
        orientation: orientation for the progress bar
    """
    self.setOrientation(constants.ORIENTATION.get_enum_value(orientation))

set_text_direction(text_direction: TextDirectionStr | widgets.QProgressBar.Direction)

Set the text direction of the layout.

Parameters:

Name Type Description Default
text_direction TextDirectionStr | Direction

text direction for the layout

required
Source code in prettyqt\widgets\progressbar.py
def set_text_direction(
    self, text_direction: TextDirectionStr | widgets.QProgressBar.Direction
):
    """Set the text direction of the layout.

    Args:
        text_direction: text direction for the layout
    """
    self.setTextDirection(TEXT_DIRECTIONS.get_enum_value(text_direction))

⌗ Property table

Qt Property Type Doc
objectName QString
modal bool
windowModality Qt::WindowModality
enabled bool
geometry QRect
frameGeometry QRect
normalGeometry QRect
x int
y int
pos QPoint
frameSize QSize
size QSize
width int
height int
rect QRect
childrenRect QRect
childrenRegion QRegion
sizePolicy QSizePolicy
minimumSize QSize
maximumSize QSize
minimumWidth int
minimumHeight int
maximumWidth int
maximumHeight int
sizeIncrement QSize
baseSize QSize
palette QPalette
font QFont
cursor QCursor
mouseTracking bool
tabletTracking bool
isActiveWindow bool
focusPolicy Qt::FocusPolicy
focus bool
contextMenuPolicy Qt::ContextMenuPolicy
updatesEnabled bool
visible bool
minimized bool
maximized bool
fullScreen bool
sizeHint QSize
minimumSizeHint QSize
acceptDrops bool
windowTitle QString
windowIcon QIcon
windowIconText QString
windowOpacity double
windowModified bool
toolTip QString
toolTipDuration int
statusTip QString
whatsThis QString
accessibleName QString
accessibleDescription QString
layoutDirection Qt::LayoutDirection
autoFillBackground bool
styleSheet QString
locale QLocale
windowFilePath QString
inputMethodHints QFlags
minimum int
maximum int
text QString
value int
alignment QFlags
textVisible bool
orientation Qt::Orientation
invertedAppearance bool
textDirection QProgressBar::Direction
format QString