Line a baking dish with baking paper, roll out your sheet of pastry over your baking dish, and press the dough well against the sides, place a baking paper over it and fill it ¾ with baking beans or baking pearls.
Blind bake for 25' at 180°.
Remove the baking paper and the baking beans.
Meanwhile, stew the leeks for about 10 minutes in the butter. The leeks should not really color but should be soft and have no moisture left; otherwise, you can press it a bit in a sieve.
Cut the ham into cubes and mix it with the leeks.
Beat the eggs well with the cream, season with plenty of pepper, salt, and nutmeg.
Add half of the cheese.
Mix this mixture with the leeks and ham and pour it all into the baking dish with the baked pastry, finishing with the rest of the grated cheese.
Let it bake for 30 to 35 minutes in a preheated oven at 185°.
Depending on whether your dish is larger or smaller, the cooking time will vary.
When you gently shake the dish, the center should not be wobbly anymore.
Let it rest for 5 minutes and then cut it.
Serve with a simple salad if desired.