if (child != null && child.childCount() > 0) {
int count = child.childCount();
QTreeWidgetItem parent = child;
int localTotal = 0;
for (int j=0; j<count; j++) {
child = parent.child(j);
int childCount = updateCounts(child, books, counts, blue, black);
total = total+childCount;
localTotal = localTotal+childCount;
}
parent.setText(1, new Integer(localTotal).toString());