code: def get_word_under_cursor_legacy(self):
          
  
          cursor = self.textCursor()
          cursor.select(QTextCursor.WordUnderCursor)
          return cursor.selectedText()
docs: Returns the document word under cursor ( Using Qt legacy "QTextCursor.WordUnderCursor" ).
  
          :return: Word under cursor.
          :rtype: QString