Knead the flour, water, butter or margarine and 1/2 teaspoon salt to make a shortcrust pastry. Cover and let rest in the refrigerator for half an hour.
In the meantime, peel and dice the onion and garlic, chop the spinach leaves if necessary. Heat olive oil in a pan and fry the onion and garlic until translucent. Add the spinach for 2 - 3 minutes, then remove from the heat.
Chop the cashew nuts into smaller pieces and briefly toast them in a pan without oil. Crumble the tofu, mix all the ingredients for the filling and season with salt, pepper, basil and rosemary.
Grease a quiche pan and dust with flour. Cover with the dough and distribute the filling evenly on top. Bake in the preheated oven at 200 ° C (top / bottom heat) for half an hour. Then let it cool down for a while and then carefully cut it open.