code: def onAutoIndentTriggered(self):
          
          cursor = self._qpart.textCursor()
  
          startBlock = self._qpart.document().findBlock(cursor.selectionStart())
          endBlock = self._qpart.document().findBlock(cursor.selectionEnd())
  
          if startBlock != endBlock:  # indent multiply lines
              stopBlock = endBlock.next()
  
              block = startBlock
  
              with self._qpart:
                  while block != stopBlock:
                      self.autoIndentBlock(block, '')
                      block = block.next()
          else:  # indent 1 line
              self.autoIndentBlock(startBlock, '')
docs: Indent current line or selected lines