Results 1 to 14 of 14

Thread: How get signal returnPressed in QTextEdit

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Join Date
    Dec 2009
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8

    Default Re: How get signal returnPressed in QTextEdit

    I don't know what is wrong here:
    Qt Code:
    1. bool SimpleChatClient::eventFilter(QObject *obj, QEvent *event)
    2. {
    3. if (obj == message) {
    4. if (event->type() == QEvent::KeyPress) {
    5. QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
    6. switch(keyEvent->key()) {
    7. case Qt::Key_Enter:
    8. case Qt::Key_Return:
    9. sendMessage();
    10. break;
    11. }
    12. return false;
    13. } else {
    14. return QObject::eventFilter(obj, event);
    15. }
    16. } else {
    17. return QObject::eventFilter(obj, event);
    18. }
    19. }
    To copy to clipboard, switch view to plain text mode 
    And I don't know how to does it remake to work properly.
    Last edited by Xandareva; 30th December 2009 at 10:44.

Similar Threads

  1. signal for QTextEdit
    By bismitapadhy in forum Qt Programming
    Replies: 5
    Last Post: 25th December 2009, 14:23
  2. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 08:16
  3. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 08:04
  4. QSpinBox and returnPressed() Signal
    By BeS in forum Newbie
    Replies: 2
    Last Post: 14th October 2006, 20: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.