Results 1 to 5 of 5

Thread: Memory Leak in my Application :-(

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    91
    Thanks
    21
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Memory Leak in my Application :-(

    Can you further define "QObject Children" of an object.

  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: Memory Leak in my Application :-(

    That means all the QObject's returned by a call to QObject::children().
    A QObject can become the child of another QObject through any number of means( they really are quite a few, I am not going to list them all), but generally:
    • When you create widgets or objects and pass a parent to the constructor
    • When you add widgets(that don't yet have a parent) to a layout(that doesn't yet have a parent) and you set that layout to another widget. The latter becomes the parent for both the layout and the children within
    Also note that you can change the order in which the children appear in the list by QWidget::raise and QWidget::lower.

    If you're interested in these matters, then of special interest should be QObject::deleteLater and QObject::destroyed.

    Regards

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

    bruccutler (27th July 2007)

  4. #3
    Join Date
    Jan 2007
    Posts
    91
    Thanks
    21
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Memory Leak in my Application :-(

    I particularly like the QObjectCleanupHandler. This will be very helpful in tracking memory problems too.

Similar Threads

  1. 'memory leak' threads on QT centre
    By locus in forum Qt Programming
    Replies: 1
    Last Post: 29th January 2007, 17:44
  2. Replies: 3
    Last Post: 8th December 2006, 18:51
  3. Memory leak
    By vvbkumar in forum General Programming
    Replies: 4
    Last Post: 2nd September 2006, 15:31
  4. Memory leak
    By zlatko in forum Qt Programming
    Replies: 8
    Last Post: 28th March 2006, 19:02
  5. Qt 4.1 Memory Leak
    By blackliteon in forum Qt Programming
    Replies: 14
    Last Post: 10th February 2006, 12:47

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.