QTextCursor select part of a word?
Ok, I can't figure this out from the Qt documentation, it just isn;t clear to me. If I have this text:
asdf
and the QTextCursor is positioned between the 's' and the 'd', how can I select "df"? I don't see any way of selecting one character at a time. Selection modes are:
entire document
block of text under cursor (which I read to be paragraphs)
line under text cursor
...um so how do I do this?
Paul
Re: QTextCursor select part of a word?
This should do the trick:
Re: QTextCursor select part of a word?
Well, that will let me move the QTextCursor one character at a time, but how do I select characters like that? I don't see anything like setSelectionStart()
Paul
Re: QTextCursor select part of a word?
Quote:
Originally Posted by
thomaspu
Well, that will let me move the QTextCursor one character at a time, but how do I select characters like that? I don't see anything like setSelectionStart()
Just like Jacek proposed. Quoting QTextCursor::movePosition() docs:
Quote:
If mode is KeepAnchor, the cursor selects the text it moves over. This is the same effect that the user achieves when they hold down the Shift key and move the cursor with the cursor keys.
Re: QTextCursor select part of a word?
Ah, ok. Thats what I missed