[Qt-interest] user QTextCursor to select text

light frank franklightcn at gmail.com
Fri Nov 19 08:31:31 CET 2010


I have some problems in using QTextCursor. Imaging that I have a long line,
e.g. 1000 words in one line, and put it to a QTextEdit.
And the width of the text edit is set to 100px. then we can see that the
1000 words line is break down by the bound of the text edit to many lines.
But then if I use QTextCursor::select(QTextCursor::LineUnderCursor) to
select the 1st line in the text edit, I will get the all 1000 words, not the
first line in the text edit, which is not what I expected.
How can I select the first line in the text edit?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101119/dd2f9d90/attachment.html 


More information about the Qt-interest-old mailing list