Let's look at the two plots and then see how to convert one to the other. This is a sample of 30 standard normal random values:

The red curve in the left plot is a standard normal cdf - the theoretical model being used in this example - and the red curve on the right is the y=x line rather than the usual fitted line based on the data.
Now a Kolmogorov-Smirnov test finds the greatest vertical distance between the sample cdf (ecdf) and the theoretical for a completely specified distribution (a Lilliefors test would find the same distance but for a fitted distribution; it has smaller critical values as a result).
The position of that greatest vertical distance is marked. You could convert the red curve to a straight line by applying a standard normal cdf to the data. If the model is correct should convert it to a standard uniform), producing something rather close to an empircal-vs-theoretical P-P plot.
On the other hand, if we stretch that vertical axis in the ECDF by applying an inverse normal cdf, it will also straighten out the line. Unfortunately, the rightmost cdf value (that of the last data value) will end up stretched off to infinity. We don't expect the largest observation to be at infinity. So instead of tranforming the ecdf itself, we modify it slightly yield something more like the expected order statistic. Typically this is achieved by replacing $i/n$ for the $i$th value by $\frac{i-\alpha}{n+1-2\alpha}$ for some $\alpha$ in $[0,1)$. Many programs use $\alpha=\frac{3}{8}$, though R (which I used for the plots above) only uses that for small $n$; for $n>10$ it uses $\alpha=\frac12$. This treats the largest and smallest values symmetrically, stretching them the same distance from the center (and similarly for each pair further in).
With that change to the ecdf (from $u_i=i/n$ to $u_i^*=\frac{i-\alpha}{n+1-2\alpha}$) and then the transformation by the inverse of the normal cdf, we then have a Q-Q plot (though with the axes transposed -- that is with the theoretical quantiles on the y-axis rather than the x-axis).
Because of that stretching the distances measured by the K-S test are not preserved.
Is we instead stick to a P-P plot (but without the conversion to $u_i^*$, and again keeping the transformed observed data on the x-axis), where we squish up the x-axis instead of stretching the y-axis, that doesn't change the vertical distances, and that will preserve the Kolmogorov-Smirnov distance.
A more typical measure of fit used with a Q-Q plot would be based on the correlation. Indeed the Shapiro-Francia statistic (closely related to the Shapiro Wilk) and the quite similar Ryan-Joiner-Ryan statistic both look at something related to the correlation in the right hand plot.