Results 1 to 2 of 2

Thread: how can I execute some code before mainwindow is close

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    46
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default how can I execute some code before mainwindow is close

    Hey all,
    I would like to execute a QDialog when the user close the main window of the application (by clicking on the cross at the top right of the window for most people). How could I do that?
    thanx in advance

    Pat

  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: how can I execute some code before mainwindow is close

    Override mainwindow's closeEvent(), launch the dialog in there and possibly accept or ignore the event according to the dialog result.
    J-P Nurmi

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

    patcito (1st June 2006)

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.