Can you further define "QObject Children" of an object.
Can you further define "QObject Children" of an object.
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:
Also note that you can change the order in which the children appear in the list by QWidget::raise and QWidget::lower.
- 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
If you're interested in these matters, then of special interest should be QObject::deleteLater and QObject::destroyed.
Regards
bruccutler (27th July 2007)
I particularly like the QObjectCleanupHandler. This will be very helpful in tracking memory problems too.
Bookmarks