Results 1 to 6 of 6

Thread: Qt closeevent and garbage collection

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2011
    Posts
    1,241
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3
    Thanked 127 Times in 126 Posts

    Default Re: Qt closeevent and garbage collection

    or use Qt::WA_DeleteOnClose
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

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

    ehnuh (2nd November 2012)

  3. #2
    Join Date
    Sep 2012
    Posts
    31
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    15

    Default Re: Qt closeevent and garbage collection

    the delete applies when creating the object using the new keyword. so if I declare my widget to be, QWidget BasicWidget.....this would automatically be deleted once I close my application?

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Qt closeevent and garbage collection

    Quote Originally Posted by ehnuh View Post
    the delete applies when creating the object using the new keyword. so if I declare my widget to be, QWidget BasicWidget.....this would automatically be deleted once I close my application?
    All memory is freed when you close your application, regardless how the object is created. It only matters if a destuctor of an object is called or not.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    ehnuh (4th November 2012)

Similar Threads

  1. QList and garbage collection
    By zgulser in forum Qt Programming
    Replies: 3
    Last Post: 5th April 2012, 14:38
  2. Garbage collector - PyQt
    By janosimas in forum Newbie
    Replies: 0
    Last Post: 11th December 2011, 11:05
  3. Garbage collection
    By Septi in forum Qt Programming
    Replies: 5
    Last Post: 6th July 2010, 14:13
  4. QString, QStringList and garbage collection...
    By PaladinKnight in forum Newbie
    Replies: 4
    Last Post: 5th April 2010, 16:22
  5. question about garbage collection
    By Dumbledore in forum Qt Programming
    Replies: 4
    Last Post: 18th December 2007, 22:08

Tags for this Thread

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.