[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Closing QMainWindow with a bunch of child dialogs...
From:       Dirk Wagener <dwagen () stonethree ! com>
Date:       2007-11-27 11:18:23
Message-ID: 474BFCFF.9070204 () stonethree ! com
[Download RAW message or body]

Hi

I have this situation:
I have a QMainWindow (parent) with a bunch of children dialogs.
One of the children is a dialog containing a QTabWidget with a bunch of 
QWidget tabs.

I now close the main window by clicking on the close button, which 
trigger a closeEvent().
In my closeEvent(self, event) method, I do the following:
* call accept() on the dialog containing the tab widget
* call accept() on all open dialogs
* call event.accept() on the close event received by this main window

My question is this:
What is the correct way to close a parent and all its children to ensure 
that
garbage collection happens properly?
I am confused about the use of accept(), close() or destroy() to get rid 
of dialogs.

Also, the dialog that contains a tab widget - should I close all the tab 
widgets (QWidgets)
and the QTabWidget when closing this dialog?

Kind regards
Dirk Wagener
-- 

Dirk Wagener <dwagen@stonethree.com>
(MSc. Electronic Engineering, Stell.)

Project Engineer
Stone Three Signal Processing (Pty.) Ltd.
http://www.stonethree.com
+27 21 851 3123 (phone)
+27 21 851 3127 (fax) 


We shall not cease from exploration and the end of all our exploring will
be to arrive where we started... and know the place for the first time.
T.S. Eliot

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic