(self, rect, dy)
Repaint line number area if necessary
Repaint line number area if necessary
Repaint line number area if necessary
def __updateRequest(self, rect, dy):
        """Repaint line number area if necessary
        """
        if dy:
            self.scroll(0, dy)
        elif self._countCache[0] != self._editor.blockCount() or \
                self._countCache[1] != self._editor.textCursor().block().lineCount():

            # if block height not added to rect, last line number sometimes is not drawn
            blockHeight = self._editor.blockBoundingRect(self._editor.firstVisibleBlock()).height()

            self.update(0, rect.y(), self.width(), rect.height() + round(blockHeight))
            self._countCache = (
                self._editor.blockCount(), self._editor.textCursor().block().lineCount())

        if rect.contains(self._editor.viewport().rect()):
            self._editor.updateViewportMargins()
def __updateRequest ( self , rect , dy ) : if dy : self . scroll ( 0 , dy ) elif self . _countCache [ 0 ] != self . _editor . blockCount ( ) or self . _countCache [ 1 ] != self . _editor . textCursor ( ) . block ( ) . lineCount ( ) : # if block height not added to rect, last line number sometimes is not drawn blockHeight = self . _editor . blockBoundingRect ( self . _editor . firstVisibleBlock ( ) ) . height ( ) self . update ( 0 , rect . y ( ) , self . width ( ) , rect . height ( ) + round ( blockHeight ) ) self . _countCache = ( self . _editor . blockCount ( ) , self . _editor . textCursor ( ) . block ( ) . lineCount ( ) ) if rect . contains ( self . _editor . viewport ( ) . rect ( ) ) : self . _editor . updateViewportMargins ( )