Results 1 to 14 of 14

Thread: How get signal returnPressed in QTextEdit

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How get signal returnPressed in QTextEdit

    Quote Originally Posted by Xandareva View Post
    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):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  2. The following user says thank you to faldzip for this useful post:

    Xandareva (30th December 2009)

Similar Threads

  1. signal for QTextEdit
    By bismitapadhy in forum Qt Programming
    Replies: 5
    Last Post: 25th December 2009, 13:23
  2. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  3. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 07:04
  4. QSpinBox and returnPressed() Signal
    By BeS in forum Newbie
    Replies: 2
    Last Post: 14th October 2006, 19:23

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.