Thx, but i know it.
I want to select text and dont move cursor position.
Just trying select text, for example all current line and dont move cursor position.
I trying.
cursor.setPosition(nStartSelectionPos);
cursor.
setPosition(nEndSelectionPos,
QTextCursor::moveAnchor);
setTextCursor(cursor);
QTextCursor cursor = textCursor();
cursor.setPosition(nStartSelectionPos);
cursor.setPosition(nEndSelectionPos, QTextCursor::moveAnchor);
setTextCursor(cursor);
To copy to clipboard, switch view to plain text mode
Yeah and cursor was stayed in end of selection text.
If do it, like this :
int nCurPos = cursor.position();
cursor.setPosition(nStartSelectionPos);
cursor.
setPosition(nEndSelectionPos,
QTextCursor::moveAnchor);
cursor.setPosition(nCurPos);
setTextCursor(cursor);
QTextCursor cursor = textCursor();
int nCurPos = cursor.position();
cursor.setPosition(nStartSelectionPos);
cursor.setPosition(nEndSelectionPos, QTextCursor::moveAnchor);
cursor.setPosition(nCurPos);
setTextCursor(cursor);
To copy to clipboard, switch view to plain text mode
No selected text, because cursor is moving - its my problem.
Bookmarks