So, the method select(SelectionType) in the class QTextCursor only has 4 possible parameters.
QTextCursor::Document
QTextCursor::BlockUnderCursor
QTextCursor::LineUnderCursor
QTextCursor::WordUnderCursor
Is it possible to create custom selectiontypes? Say if I want to select the text from position 5 to 9. Thanks!
Use
setPositionlike this:This will set the cursor’s Anchor to 5 and its Position to 9. The selection is the text between anchor and position.