The static function QObject::objectTrees() gives you access to all the root objects that currently exist.
QWidget, the base class of everything that shows up on the screen, extends the parent/child relationship: a child normally also becomes a so-called child widget, i.e. it is displayed in its parent's coordinate system and is graphically clipped by its parent's boundaries. Thus, when the the application deletes a message box after it's been closed, the message box' OK button is deleted too, just the way you would want, because the button is a child of the message box.
Of course, you can also delete a child object yourself, and it will remove itself from its parent. For example, when the user removes a toolbar that could often result in the application deleting one of the QToolBar objects, and the tool bar's QMainWindow parent would then notice the change and reconfigure its screen space.
The debugging functions QObject::dumpObjectTree() and QObject::dumpObjectInfo() are often useful when an application looks or acts strangely.
Copyright © 2000 Trolltech | Trademarks | Qt version 2.2.1
|