code: def _selectedBlocks(self):
          
          cursor = self.textCursor()
          return self.document().findBlock(cursor.selectionStart()), \
                 self.document().findBlock(cursor.selectionEnd())
docs: Return selected blocks and tuple (startBlock, endBlock)