Results 1 to 2 of 2

Thread: Question about close program event.

  1. #1
    Join Date
    Mar 2015
    Posts
    105
    Thanks
    50

    Default Question about close program event.

    Good evening!

    I have a program where i would like to do one last thing(call a mehtod) before i close it with that [x] button, or righ click on the mouse and choose close option.

    I know to do that when i create a button and implement a pressButton event, but now i don't have this button. Just that default [x] and right mouse button option. How can i do that?

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

    Default Re: Question about close program event.

    You overwrite the window's closeEvent() handler.

    Cheers,
    _

Similar Threads

  1. Replies: 4
    Last Post: 17th September 2012, 16:23
  2. Replies: 2
    Last Post: 17th December 2010, 20:01
  3. how to catch close event in this program? [pyqt]
    By pyqt123 in forum Qt Programming
    Replies: 15
    Last Post: 14th December 2009, 12:30
  4. close event
    By IRON_MAN in forum Qt Programming
    Replies: 11
    Last Post: 2nd October 2009, 09:12
  5. Close event
    By gyre in forum Newbie
    Replies: 3
    Last Post: 20th November 2007, 14:49

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.