Quality optimization greatly improves coding efficiency by optimizing Quantization Parameter (QP). Recently, preanalysis module to evaluate temporal information propagation inter-frames is used to adaptively adjust QP for each coding unit (CU). However, considering characteristics of Screen Content Coding (SCC), problems exist in module design and QP generation part for screen content. For module design, SCC mainly uses intra-frame compression tools, which haven't been included in current information propagation model. For QP generation, CUs in fixed-size quantization group (QG) are encoded with same QP, which is imprecise for screen content. This paper proposes intra-frame backwards pre-Analysis method and flexible QG size adjustment method for SCC quality optimization. Proposed intra-frame pre-Analysis method extends information propagation model by adding intra-frame analysis. Before compression, pre-Analysis module finds all intra-frame references and generates importance for each micro block. Proposed flexible QG size is applied during compression and make QG size fit actual CU size. Thus, one QG only contains one CU, so QP of current CU is generated only from the average importance of micro blocks belonging to it, without influenced by micro blocks in other CUs. The experiment shows that proposed algorithm achieves 0.571% BD-rate reduction for the All Intra (AI) configuration with less than 5% encoding time increasing under the SCC common test condition. And the proposed algorithms are conducted in VTM version 5, the standard test environment for Versatile Video Coding (VVC). This work explores the potentiality of quality optimization for screen content and will make contribution to the development of next generation SCC standard.