In Example 8.4, what local stack objects were destroyed when growBunch()
returned?
Notice that Alice does not appear in the dumpObjectTree()
output. When does Alice get destroyed?
Write your own function,
void showTree(QObject* theparent)
to main.cpp. The output of this function, after all objects have been created, should look like this:
Member: Mike - Parent: A Stack Object Member: Greg - Parent: Mike Member: Peter - Parent: Mike Member: Bobby - Parent: Mike Member: Carol - Parent: A Stack Object Member: Marcia - Parent: Carol Member: Jan - Parent: Carol Member: Cindy - Parent: Carol
Modify your showTree()
function so that it produces the same output as dumpObjectTree()
.
[ fromfile: children.xml id: None ]
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |