[guided]Let $(\Omega,\mathcal F,\mathbb P)$ be the probability space on which the observed time series, fitted residuals, and residual autocorrelations are defined. The statistic $Q_m$ only depends on the first $m$ residual autocorrelations, so we package them into a single random vector
\begin{align*}
\hat r_{m,n}: \Omega \to \mathbb{R}^{m},
\qquad
\hat r_{m,n}
=
(\hat r_1,\dots,\hat r_m).
\end{align*}
With this notation, the definition of $Q_m$ becomes
\begin{align*}
Q_m
=
n\sum_{k=1}^{m}\hat r_k^2
=
n|\hat r_{m,n}|^2
=
|\sqrt{n}\,\hat r_{m,n}|^2.
\end{align*}
The substantive asymptotic input is the residual autocorrelation central limit theorem included among the theorem's regularity assumptions. We check the hypotheses being used: $m$ is fixed with $m>p+q$, the fitted model is causal and invertible, the innovation and estimation regularity assumptions required for asymptotic normality are assumed, and the null hypothesis says that the fitted residuals are white noise. Therefore the theorem applies to the random vector $\hat r_{m,n}$ and gives a random vector $Z_m:\Omega\to\mathbb R^m$ and a matrix $P_m\in\mathbb R^{m\times m}$ such that
\begin{align*}
\sqrt{n}\,\hat r_{m,n}
\xrightarrow{d}
Z_m,
\qquad
Z_m \sim \mathcal{N}(0,P_m).
\end{align*}
The same central limit theorem identifies the covariance matrix $P_m$ as the orthogonal projection onto the residual-autocorrelation directions not removed by estimating the $p+q$ ARMA parameters. Equivalently,
\begin{align*}
P_m^2=P_m,
\qquad
P_m^\top=P_m,
\qquad
\operatorname{rank}(P_m)=m-p-q.
\end{align*}
This is exactly where the loss of $p+q$ degrees of freedom enters the Box-Pierce approximation.[/guided]