Min Li schrieb:
Hi everyone.
I have some trouble to retrieval the selected text in the QTextEdit. I mean
I want use mouse to select the text in the QTextEdit, and retrieval it in a
local variable.
Say your QTextEdit is te:
str = te.textCursor().selectedText()
Now str contains a QString with the selected text.
see
http://doc.trolltech.com/4.4/qtextedit.html#textCursor
http://doc.trolltech.com/4.4/qtextcursor.html#selectedText
Regards
Georg
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt