Fixed error QTextCursor::setPosition position is out of range