No.
The documentation says "Note that changes on the returned cursor do not affect QTextEdit's cursor"
http://doc.qt.io/qt-5/qtextedit.html#textCursor
You can of course ignore the documentation, but it makes it extremely unlikely that the code you have will do what you need.
Cheers,
_
Bookmarks