I think I found a method. It s a grass function included inside the sextante plugin. See the screenshot. I did a test with a shapefile that looked like yours.
More Details:
It is best to install QGIS Sextante Plugin. So you do not have to worry about importing/exporting to grass datasets.
The tool is Located in
Sextante toolbox > Grass Commands > Vector > v.overlay
Just open the tool and use the default parameters and you get the results in a new layer