Modulation of the Purcell effect by controlling both the Q-factor and detuning in a quantum-dot-nanocavity coupled system was investigated. The Q-factor and detunings are controlled independently by using a nanocavity, a waveguide and a reflector formed in a two-dimensional photonic crystal slab, in combination with a newly developed nitrogen adsorption/desorption technique that enables local control of the refractive index. We investigated analytically and experimentally how the density of states of cavity mode is modulated, and we experimentally clarified how the emission of a quantum dot on resonance with a cavity is modulated. We observed that the emission of a quantum dot via a cavity mode was increased by 3.3 times when the Q-factor was changed from 3,500 to 6,900 while keeping the detuning fixed. The dependence of the Purcell effect on the Q-factor was directly observed.