I have one question. How can I move cursor to begin of QTextEdit? Why do I want to move cursor? Because if I press Enter, Message will send to server and all is ok, but I have one problem, Cursor has been in second line after pressed Enter ;/ and if I send second message (press Enter), message will send with word of new line. I would cursor will be in first line after pressed enter.
Thanks for reply
It seems that when you send a message and pass keyPressEvent further (to the default implementation) so it is then inserting new line. You must "eat" the event and not pass it further: accept it (QEvent::accept()) and not pass it to the base class implementation.
I would like to be a "Guru"
Useful hints (try them before asking):
Use Qt Assistant
Search the forum
If you haven't found solution yet then create new topic with smart question.
Bookmarks