I would like tell you what I know about the answer to this question.
So, it's known that the selection rules for a fine vibrational spectrum (rotational-vibrational spectrum) for diatomic molecules make $\Delta J = 0$ or $\pm 1$ transitions allowed between the rotational levels of two vibrational states (usually $V''=0$ to $V'=1$, where the symbols have their usual meaning). But one must be careful in realizing that the $\Delta J = 0$ transition is forbidden for all parallel vibrations in the oscillator and only allowed for perpendicular vibrations.
Now, let's see what are parallel and perpendicular vibrations!
Any vibrational mode in infrared active only when the change in the dipole moment vector is sinusoidal w.r.t. time and thus can interact with the electric field of the electromagnetic radiation. If this change in the dipole moment vector is parallel to the major axis of the molecule, then the vibrational is labelled as a parallel mode of vibration. If the change in the dipole moment is perpendicular w.r.t. the major molecular axis, it is a perpendicular mode of vibration.
Let's look at the case of diatomic molecule, as the question is focused on that.
The major molecular axis for it is the bond axis (containing both the atoms). Since a hetero-nuclear diatomic molecule has only one vibrational mode, viz., stretching, it can only occur parallel to the bond axis. Therefore, $\Delta J = 0$ transition is forbidden in the case of parallel vibrations. Thus, on observing the fine infrared spectrum of hetero-nuclear diatomic molecules, we only observe $P$ and $R$ branches. $Q$ branches are not observed.
Fundamentals of Molecular Spectroscopy - Banwell and McCash
Introduction to Molecular Spectroscopy - Gordon M. Barrow
Atomic and Molecular Spectroscopy - Rita Kakkar