(self, painter, rect, logicalIndex)
Reimplemented from `QHeaderView`.
Reimplemented from `QHeaderView`.
Reimplemented from QHeaderView .
def paintSection(self, painter, rect, logicalIndex):
        # type: (QPainter, QRect, int) -> None
        """
        Reimplemented from `QHeaderView`.
        """
        # What follows is similar to QHeaderView::paintSection@Qt 6.0
        if not rect.isValid():
            return  # pragma: no cover
        oldBO = painter.brushOrigin()

        opt = QStyleOptionHeader()
        opt.rect = rect
        self.initStyleOption(opt)

        oBrushButton = opt.palette.brush(QPalette.Button)
        oBrushWindow = opt.palette.brush(QPalette.Window)

        self.initStyleOptionForIndex(opt, logicalIndex)
        opt.rect = rect

        nBrushButton = opt.palette.brush(QPalette.Button)
        nBrushWindow = opt.palette.brush(QPalette.Window)

        if oBrushButton != nBrushButton or oBrushWindow != nBrushWindow:
            painter.setBrushOrigin(opt.rect.topLeft())
        # draw the section
        self.style().drawControl(QStyle.CE_Header, opt, painter, self)

        painter.setBrushOrigin(oldBO)
def paintSection ( self , painter , rect , logicalIndex ) : # type: (QPainter, QRect, int) -> None # What follows is similar to QHeaderView::paintSection@Qt 6.0 if not rect . isValid ( ) : return # pragma: no cover oldBO = painter . brushOrigin ( ) opt = QStyleOptionHeader ( ) opt . rect = rect self . initStyleOption ( opt ) oBrushButton = opt . palette . brush ( QPalette . Button ) oBrushWindow = opt . palette . brush ( QPalette . Window ) self . initStyleOptionForIndex ( opt , logicalIndex ) opt . rect = rect nBrushButton = opt . palette . brush ( QPalette . Button ) nBrushWindow = opt . palette . brush ( QPalette . Window ) if oBrushButton != nBrushButton or oBrushWindow != nBrushWindow : painter . setBrushOrigin ( opt . rect . topLeft ( ) ) # draw the section self . style ( ) . drawControl ( QStyle . CE_Header , opt , painter , self ) painter . setBrushOrigin ( oldBO )