(self)
return cursor.block().text()[:cursor.positionInBlock()]
Text in current block from start to cursor position
Text in current block from start to cursor position
Text in current block from start to cursor position
def textBeforeCursor(self):
        """Text in current block from start to cursor position
        """
        cursor = self.textCursor()
        return cursor.block().text()[:cursor.positionInBlock()]
def textBeforeCursor ( self ) : cursor = self . textCursor ( ) return cursor . block ( ) . text ( ) [ : cursor . positionInBlock ( ) ]