The shape of truncated square-based pyramid quantum dots (QDs) is similar to that of real QDs in experiments. The electronic band structures and optical gain of InAs 1−x N x /GaAs QDs are calculated by using the 10-band k⋅p model, and the strain is calculated by the valence force field (VFF) method. When the top part of the QD is truncated, greater truncation corresponds to a flatter shape of the QD. The truncation changes the strain distribution and the confinement in the z direction. A flatter QD has a greater C1–HH1 transition energy, greater transition matrix element, less detrimental effect of higher excited transition, and higher saturation gain and differential gain. The trade-off between these properties must be considered. From our results, a truncated QD with half of its top part removed has better overall performance. This can provide guidance to growing QDs in experiments in which the proper growing conditions can be controlled to achieve required properties.