Shanghai has been raked the top mainland city for quality of living, according to a ranking report released on Wednesday.