Results 1 to 13 of 13

Thread: Destructor not being called

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Destructor not being called

    Quote Originally Posted by vieraci View Post
    Why would MainWindow's dtor have anything to do with it ?
    ... I see it now .....
    in the ctor, it needed:
    Qt Code:
    1. setAttribute(Qt::WA_DeleteOnClose);
    To copy to clipboard, switch view to plain text mode 

    Thanks for the kick !
    because, if you remeber, when you pass a parent into ctor of objects which subclassed from QObject Qt will delete all children by itself when a parent's dtor is being called. but if you don't pass a parent in ctor of objects then you have to delete these objectcs by yourself.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  2. The following user says thank you to spirit for this useful post:

    vieraci (15th May 2009)

Similar Threads

  1. setSceneRect not being called properly?
    By bjh in forum Qt Programming
    Replies: 7
    Last Post: 12th July 2009, 19:42
  2. Replies: 4
    Last Post: 19th April 2009, 15:51
  3. filterAcceptsRow is not called.
    By kaushal_gaurav in forum Qt Programming
    Replies: 1
    Last Post: 10th February 2009, 08:05
  4. Replies: 1
    Last Post: 7th August 2008, 13:46
  5. QWidget::resizeEvent is not called
    By maximAL in forum Qt Programming
    Replies: 9
    Last Post: 3rd February 2008, 16: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
  •  
Qt is a trademark of The Qt Company.