Yes, it is necessary, like I said.

In the .h file you only use 'class myMainForm'. In the .cpp file you use '#include "mymainform.h"'.

This way you won't get compiler errors, and you won't have recursive inclusion (which would only have happened with '#include ...' in the .h file).