Contrary to the currently accepted answer, I'll point out that while the quantiles always exist, i.e. are finite for every $p \in (0, 1)$, this does not mean for instance the equation you have found relating the quantile function and the expectation is incorrect. The quantile function will always be finite whenever the random variable in question is always finite; we do not say that there is no relationship between the expectation/variance of X and the values of X, such as through equations like $\mathbb{E}(X) = \int xF(dx)$ or $\mathrm{Var}(X) = \int (x-\mathbb{E}(X))^2 F(dx)$, merely on the basis that the moments may be infinite or not even exist, while the integral happens over $\mathbb{R}$. In fact, it can be instructive to try evaluating these sorts of integrals (or more careful representations like the integrals of the positive and negative parts of $X$, which individually always exist, even if not finite) to understand why those quantities may still be problematic.
There is a somewhat intuitive form for the variance relating it to the quantile function, which you have started to obtain, as the $\ell_2$ norm of the "centered" quantile function (just as the variance is the $F$-weighted $\ell_2$ norm of the "centered" values of $X$). The derivation below will assume $X$ is absolutely continuous with respect to the Lebesgue measure (i.e. "continuous"), and has finite variance (hence finite expectation). This uses some of the implicit differentiation tricks utilized in the link you provided. However, let's begin upstream a little from where you started:
$$
\begin{aligned}
\mathrm{Var}(X) &= \mathbb{E}[(X-\mathbb{E}(X))^2] \\
&= \int [x - \mathbb{E}(X)]^2 f(x) dx \\
&= \int [x^2 - 2x\mathbb{E}(X) + \mathbb{E}(X)^2] f(x) dx \\
&= \int x^2 f(x) dx - 2\mathbb{E}(X) \int xf(x) dx + \mathbb{E}(X)^2 \\
&= \int_0^1 Q(p)^2 dp - 2\mathbb{E}(X)\int_0^1 Q(p)dp + \mathbb{E}(X)^2 \\
&= \int_0^1 [Q(p) - \mathbb{E}(X)]^2 dp.
\end{aligned}
$$
Of course, maybe you'd prefer:
$$
\mathrm{Var}(X) = \int_0^1 \left[ Q(p) - \int_0^1 Q(q) dq \right]^2 dp.
$$
I myself would call this a direct relation between the quantile function and the variance. I suppose this holds for any random variable, continuous or otherwise, by expressing any discrete random variable's distribution function as a limit of a sequence of continuous random variables' distribution functions. Maybe there needs to be some care in how that is constructed.