Quickly knead a shortcrust pastry from the flour, cold butter, egg, salt and possibly some water. Wrapped in foil, store in the refrigerator for about 30 minutes.
In the meantime, chop the leek, ham and onion and fry briefly in a pan. Let cool down. Season with salt and pepper.
Roll out the cold dough and press it into a prepared tart pan. Prick the bottom with a fork. Spread the leek and ham mixture on top. Mix the cream and eggs, season and pour over. Sprinkle with cheese.
Bake in a hot oven for approx. 30 - 40 minutes at 200 degrees top / bottom heat.