Problems with QTextCursor::movePosition
here:
bool mooved = cursor.movePosition(QTextCursor::Start);
while(mooved && cursor.position() < toPlainText().size()) {
cursor.select(QTextCursor::WordUnderCursor);
mooved = cursor.movePosition(QTextCursor::NextWord);
}
I have 2 questions:
1) mooved is always true even no more words left. At end of text. So I added "cursor.position() < toPlainText().size()". Is it right?
2) going throw this text "If you reimplement this handler, it is very important that you ignore() the event if you do not understand it, so that the widget's parent can interpret it" never ends and stay at "ignore".
Whats wrong?
Re: Problems with QTextCursor::movePosition
Quote:
Originally Posted by js67257
1) mooved is always true even no more words left. At end of text. So I added "cursor.position() < toPlainText().size()". Is it right?
I think so. It tells you that the operation did succeed and not if it changed the position of the cursor.
Quote:
2) going throw this text "If you reimplement this handler, it is very important that you ignore() the event if you do not understand it, so that the widget's parent can interpret it" never ends and stay at "ignore".
Whats wrong?
What handler? What doesn't end and stays at ignore?