Results 1 to 2 of 2

Thread: Destructor in QT

  1. #1
    Join Date
    Jul 2007
    Posts
    104
    Thanks
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Destructor in QT

    Lets think we created a form using designer and used it in our application.uic is creating a header file as you know.In it there are many pointers.I want to learn how these are deleted automaticly?
    I am deleting them in my class destructor.Will I delete them in my destructor?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Destructor in QT

    I am deleting them in my class destructor.Will I delete them in my destructor?
    A man's gotta do what a man's gotta do.

    Lets think we created a form using designer and used it in our application.uic is creating a header file as you know.In it there are many pointers.I want to learn how these are deleted automaticly?
    A QObject deletes all its children. Assuming all your widgets are created with the window or dialog(the form) as parent, then they will get deleted when the dialog/window gets deleted.
    You don't need to delete them yourself, just make sure you delete the form if you allocate it dynamically.

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.