(pb: QProgressBar)
return dock
Dock for the progress bar. Giving it a blank title bar,
        making sure to set focus back to the reviewer.
Dock for the progress bar. Giving it a blank title bar,
        making sure to set focus back to the reviewer.
Dock for the progress bar . Giving it a blank title bar making sure to set focus back to the reviewer .
def _dock(pb: QProgressBar) -> QDockWidget:
    """Dock for the progress bar. Giving it a blank title bar,
        making sure to set focus back to the reviewer."""
    dock = QDockWidget()
    tWidget = QWidget()
    dock.setObjectName("pbDock")
    dock.setWidget(pb)
    dock.setTitleBarWidget(tWidget)

    # Note: if there is another widget already in this dock position, we have to add ourself to the list

    # first check existing widgets
    existing_widgets = [widget for widget in mw.findChildren(QDockWidget) if mw.dockWidgetArea(widget) == dockArea]

    # then add ourselves
    mw.addDockWidget(dockArea, dock)

    # stack with any existing widgets
    if len(existing_widgets) > 0:
        mw.setDockNestingEnabled(True)

        if dockArea == Qt.TopDockWidgetArea or dockArea == Qt.BottomDockWidgetArea:
            stack_method = Qt.Vertical
        if dockArea == Qt.LeftDockWidgetArea or dockArea == Qt.RightDockWidgetArea:
            stack_method = Qt.Horizontal
        mw.splitDockWidget(existing_widgets[0], dock, stack_method)

    if qbr > 0 or pbdStyle is not None:
        # Matches background for round corners.
        # Also handles background for themes' percentage text.
        mw.setPalette(palette)
    mw.web.setFocus()
    return dock
def _dock ( pb : QProgressBar ) -> QDockWidget : dock = QDockWidget ( ) tWidget = QWidget ( ) dock . setObjectName ( "pbDock" ) dock . setWidget ( pb ) dock . setTitleBarWidget ( tWidget ) # Note: if there is another widget already in this dock position, we have to add ourself to the list # first check existing widgets existing_widgets = [ widget for widget in mw . findChildren ( QDockWidget ) if mw . dockWidgetArea ( widget ) == dockArea ] # then add ourselves mw . addDockWidget ( dockArea , dock ) # stack with any existing widgets if len ( existing_widgets ) > 0 : mw . setDockNestingEnabled ( True ) if dockArea == Qt . TopDockWidgetArea or dockArea == Qt . BottomDockWidgetArea : stack_method = Qt . Vertical if dockArea == Qt . LeftDockWidgetArea or dockArea == Qt . RightDockWidgetArea : stack_method = Qt . Horizontal mw . splitDockWidget ( existing_widgets [ 0 ] , dock , stack_method ) if qbr > 0 or pbdStyle is not None : # Matches background for round corners. # Also handles background for themes' percentage text. mw . setPalette ( palette ) mw . web . setFocus ( ) return dock