Returns the document word under cursor ( Using Qt legacy "QTextCursor.WordUnderCursor" ).

        :return: Word under cursor.
        :rtype: QString

def get_word_under_cursor_legacy(self):
        """
        Returns the document word under cursor ( Using Qt legacy "QTextCursor.WordUnderCursor" ).

        :return: Word under cursor.
        :rtype: QString
        """

        cursor = self.textCursor()
        cursor.select(QTextCursor.WordUnderCursor)
        return cursor.selectedText()