Here you probably leak 'child'.

Two things about this function.
1. You could use a 'switch' instead of 'if-else if-else'
2. 'cvP->add(child)' and  'child->name = e.fieldName()' are copied in three places, perhaps you could do that outside of the 'ifs' (you will have to 'return' after detecting the error, of course).