Results 1 to 20 of 23

Thread: Calling destructors on close event

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Calling destructors on close event

    Hi...I have a question about calling constructors on close events...
    I have implemented a close event for my MainWindow plus I set an attribute of mainwindow that sets it to delete itself when closed:

    setAttribute(Qt::WA_DeleteOnClose);

    But....when I create some widgets with this mainwindow as their parent they wont delete themselves when they are displayed at the time when the mainwindow is closed. Yes they get closed with the mainwindow but I think theyre not deleted.... I dont understand that since it should deleteOnClose as set in that attribute I mentioned and with its delete it should delete all of its child widgets...
    Am I right or wrong ?
    Problem is that my app doesnt exit when I close it at the time when some of its child widgets were not closed yet and are displayed with it. When I close the app MainWindow the process is still running in the background and it does not finish running...Mainwindow gets closed but stays running in a background process....so I assumed that it has to do something with not deleting of child widgets that are displayed when closing its parents....
    Does anyone know how to fix this ?
    Thanks in advance...
    Last edited by gyre; 27th November 2007 at 06:04. Reason: updated contents

Similar Threads

  1. Close event
    By gyre in forum Newbie
    Replies: 3
    Last Post: 20th November 2007, 13: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.