Preheat the oven to 180C (350F) Gas Mark 4.
Roll out the pastry and line a 25cm (10in) ovenproof plate.
Trim the pastry so that it is a bit bigger than the plate, then fold up the edges slightly to create a slight lip.
Place the pastry on its plate in the fridge while preparing the filling ingredients.
Melt the butter in a small saucepan, add the onions and cook over a gentle heat until soft.
Whisk two of the eggs in a bowl, add the cream, the cooked onions, chopped ham, and parsley. Season with salt and pepper to taste.
Pour this mixture into the pastry case.
Carefully break the remaining eggs onto the tart, trying to keep the egg yolks intact.
Bake for 25-35 minutes until the custard is set in the center and the eggs on top are just cooked.
Serve warm or allow to cool and pack for a picnic. Cut slices of the tart straight from the plate.
