Results 1 to 13 of 13

Thread: Deleting a child widget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,349
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: Deleting a child widget

    This isn't a demo of c++ inheritance hierarchy, it is Qt parent-child hierarchy example.
    Well, yes it is, in a way. MyWidget is derived from QWidget and then from QObject, so I would expect that the body of ~QObject would be executed before the bodies of ~QWidget and ~MyWidget. This would imply that the children of the "top" widget (and the "a" widget) would be destructed by ~QObject (and thus their MyWidget destructors would execute) prior to the body of the MyWidget destructor for "top" getting executed. Thus the qDebug() statements should be issued in the order I stated.

    I guess I'll just have to build this example and step through it in the debugger.

    Edit -- never mind - see my edit a few posts above. I'll just slink away with my tail between my legs and work on why I can't get OpenGL textures to display in a QGLWidget.
    Last edited by d_stranz; 14th December 2012 at 18:52.

Similar Threads

  1. Deleting characters in QLineEdit widget
    By Santiago in forum Newbie
    Replies: 2
    Last Post: 11th November 2011, 14:18
  2. Deleting children of a widget
    By ComServant in forum Newbie
    Replies: 5
    Last Post: 7th October 2011, 00:09
  3. deleting a widget
    By john_god in forum General Programming
    Replies: 1
    Last Post: 30th December 2010, 09:36
  4. Replies: 7
    Last Post: 19th May 2010, 13:24
  5. Replies: 1
    Last Post: 28th July 2006, 14:10

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.