C++ (Qt)...QTextCursor tc = m_textEdit->textCursor();tc.select(QTextCursor::WordUnderCursor);QString str = tc.selectedText();....