Garbage collection with QT

Ken Godee ken at perfect-image.com
Wed Jun 8 17:03:27 CEST 2005


> Is there a way, to find out all references to the QMainWindow or its 
> hosted QTable, for having a mechanism to destroy them?
> 
Yes, of coarse, the docs are your friend :)

QObject::children()
QObject::removeChild()
QObject::parent()

To find all the children for an instance you
can create a loop.

An example of a dialog window function
that cleans it self up ....

================================================
def xdialog(self,vparent,info):

     vlogin = dialogwindow(parent=vparent,modal=1)

     while 1:

         vlogin.exec_loop()

         if vlogin.result() == 0:
             vparent.removeChild(vlogin)
             del vlogin
             break
================================================






More information about the Python-list mailing list