Results 1 to 2 of 2

Thread: Can i get key event ctrl+enter or enter key event in QPlainTextEdit?

  1. #1
    Join Date
    Jul 2008
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Can i get key event ctrl+enter or enter key event in QPlainTextEdit?

    Hello dear Qt users.

    I'm newbie on Qt Programming

    I'm generate some mainwindow(menu, QPlaintextEdit(for input), QPlaintextEdit(for output))

    I'm typing some text and press Enter Key in QPlaintextEdit(for input).
    then QPlaintextEdit show linefeed.

    Can i change ctrl + enter key doing linefeed? and Enter key doing QPlaintextEdit->clear().

    And I can't catch QKeyEvent in QPlaintextEdit. How to??

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can i get key event ctrl+enter or enter key event in QPlainTextEdit?

    You can either install an event filter or subclass that widget and reimplement keyPressEvent() method.

  3. The following user says thank you to jacek for this useful post:

    morgana (19th September 2008)

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.