Assessment of quality of life (QoL) cannot be based on a single criterion because QoL includes social, economic, environmental, and geographic metrics, as well as people's perceptions of the sustainability of an area. Quantification and spatial visualization of QoL allows policymakers to determine the effects of their policies and strategies on a city's overall environment. We develop a subjective and objective composite assessment of QoL, which is achieved by integrating socioeconomic and geo-physical condition with local people's perceptions of the importance of objectively measured attributes of city life. Shanghai, China's largest city, is selected as a case study. We find that QoL in Shanghai has steadily improved during the last 20 years, with relatively higher QoL scores in the city center and sub-center regions. Also, the improvements in social environment and transport accessibility have played dominant roles in contributing to QoL enhancement. Results of such composite assessment could be used to plan the future layout of city infrastructure, allocation of resources, or even the locations of a community's amenities and services, in an effective manner.