You should pass pointer to your QFile
object (which is an address) instead of passing the object itself (dereferencing is irrelevant, because it is used only with pointers, not objects). To get an address of your object, you should use the &
operator. So you have to invoke your function like this:
generateCSVHeader(&file4)
Also, you may consider using references instead of pointers.