Results 1 to 3 of 3

Thread: closing of window on pressing ESC key

  1. #1
    Join Date
    Feb 2007
    Posts
    63
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default closing of window on pressing ESC key

    Hi,

    i my application my dialog window closes on pressing the ESC key.

    But i don't want it to be like that.
    how can i disable the Esc button????????????????

    Regards

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: closing of window on pressing ESC key

    But that's the standard way how dialogs work. The question is, what features of QDialog are you actually using? Maybe it shouldn't be a dialog after all but an usual window?

    From QDialog docs:
    Escape Key
    If the user presses the Esc key in a dialog, QDialog::reject() will be called. This will cause the window to close: the closeEvent cannot be ignored.
    Ugly workaround: catch or filter the event. Better solution: use a plain QWidget instead.
    J-P Nurmi

  3. #3
    Join Date
    Feb 2007
    Posts
    63
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: closing of window on pressing ESC key

    thnx ,
    actually i switched from dialog to widget and my problem is solved

    Regards

Similar Threads

  1. Set a window as child at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 09:30
  2. Replies: 3
    Last Post: 23rd November 2007, 11:40
  3. Change shape of window / animate window
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 31st October 2007, 08:16
  4. Regarding drawing on Transparent Window
    By Shalabh in forum Qt Programming
    Replies: 3
    Last Post: 31st May 2007, 10:32
  5. move parent window to the front.
    By hvengel in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2007, 08:41

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.