Returns the character before the cursor.

        :return: Previous cursor character.
        :rtype: QString

def get_previous_character(self):
        """
        Returns the character before the cursor.

        :return: Previous cursor character.
        :rtype: QString
        """

        cursor = self.textCursor()
        cursor.movePosition(QTextCursor.PreviousCharacter, QTextCursor.KeepAnchor)
        return cursor.selectedText()