title: Pyqt: Get text under cursor
body: <p>How can I get the text under the cursor? So if I hover over it and the word was "hi" I could read it? I think I need to do something with QTextCursor.WordUnderCursor but I am not really sure what. Any help?</p>
  
  <p>This is what I am trying to work with right now:</p>
  
  <pre><code>    textCursor = text.cursorForPosition(event.pos());
      textCursor.select(QTextCursor.WordUnderCursor);
      text.setTextCursor(textCursor);
      word = textCursor.selectedText();
  </code></pre>
  
  <p>I have it selecting the text right now just so I can see it.</p>
  
  <p>Edit 2:</p>
  
  <p>What I am really trying to do is display a tooltip over certain words in the text.</p>