The general relationship between the gain and spontaneous emission spectra of a quantum dot (QD) laser is shown to hold for an arbitrary number of radiative transitions and an arbitrary QD-size distribution, The effect of microscopic parameters (the degeneracy factor and the overlap integral for a transition) on the gain is discussed. We calculate the threshold current density and lasing wavelength as a function of losses. The conditions for a smooth or step-like change in the lasing wavelength are described. We have simulated the threshold characteristics of a laser based on self-assembled pyramidal InAs QDs in the GaAs matrix and obtained a small overlap integral for transitions in the QDs and a large spontaneous radiative lifetime. These are shown to be a possible reason for the low single-layer modal gain, which limits lasing via the ground-state transition for short (several hundreds of micrometers) cavity lengths.