Results 1 to 3 of 3

Thread: probelm in keypress event

  1. #1
    Join Date
    Nov 2014
    Location
    Chennai
    Posts
    160
    Thanks
    65
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default probelm in keypress event

    if i press e in keyboard,,my application should close,,i tried (this.close) bt my application was not closed,
    my code below:
    Qt Code:
    1. widget.cpp
    2. void Widget::keyPressEvent(QKeyEvent *event)
    3. {
    4.  
    5. if(event->key()==Qt::Key_E)
    6. {
    7. this->close();
    8. }
    9. }
    To copy to clipboard, switch view to plain text mode 
    what am doing wrong?? please give me suggestion for this
    Thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: probelm in keypress event

    Have you verified that the call to close is reached?

    Cheers,
    _

  3. #3
    Join Date
    Nov 2014
    Location
    Chennai
    Posts
    160
    Thanks
    65
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: probelm in keypress event

    if my wiget in normal its executing...suppose if my widget in full screen keypress event not executing jus nw i tested
    Quote Originally Posted by anda_skoa View Post
    Have you verified that the call to close is reached?

    Cheers,
    _

Similar Threads

  1. QDialog keypress event
    By bear35645 in forum Qt Programming
    Replies: 6
    Last Post: 6th February 2015, 06:51
  2. problem with keypress event and QTableView
    By ranna in forum Qt Programming
    Replies: 4
    Last Post: 24th August 2009, 16:13
  3. how to combine keypress event and mousebuttonpress event?
    By hildebrand in forum Qt Programming
    Replies: 2
    Last Post: 26th May 2009, 23:08
  4. Problem with KeyPress event and QTableView
    By ranna in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2009, 20:01
  5. keypress event
    By vishesh in forum Qt Programming
    Replies: 2
    Last Post: 3rd November 2007, 14:12

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.