You can solve such a problem using the method of Lagrange multipliers. First note that maximizing the expression in your question is equivalent to minimizing the inverse function:
$$\min_{\mathbf{w}}\frac{\mathbf{w}^H\mathbf{Q}\mathbf{w}}{|\mathbf{w}^H\mathbf{d}|^2}\tag{1}$$
Next note that the solution of $(1)$ is invariant to scaling of $\mathbf{w}$, i.e., replacing $\mathbf{w}$ by $c\cdot\mathbf{w}$ in $(1)$ with an arbitrary scalar constant $c$ will not change the value of the function. So we may as well use a scaling such that $\mathbf{w}^H\mathbf{d}=1$ is satisfied. This scaling corresponds to a unity response for the desired signal. With this constraint, problem $(1)$ can be reformulated as
$$\min_{\mathbf{w}}\mathbf{w}^H\mathbf{Q}\mathbf{w}\qquad\textrm{s.t.}\qquad \mathbf{w}^H\mathbf{d}=1\tag{2}$$
We can solve $(2)$ using the method of Lagrange multipliers by minimizing
$$\mathbf{w}^H\mathbf{Q}\mathbf{w}-\lambda(\mathbf{w}^H\mathbf{d}-1)\tag{3}$$
Formally taking the derivative of $(3)$ with respect to $\mathbf{w}^H$ and setting it to zero gives
$$\mathbf{w}=\lambda\mathbf{Q}^{-1}\mathbf{d}\tag{4}$$
The constraint in $(2)$ is satisfied for
$$\lambda=\frac{1}{\mathbf{d}^H\mathbf{Q}^{-1}\mathbf{d}}\tag{5}$$
From $(4)$ and $(5)$ we finally obtain
$$\mathbf{w}=\frac{\mathbf{Q}^{-1}\mathbf{d}}{\mathbf{d}^H\mathbf{Q}^{-1}\mathbf{d}}\tag{6}$$
Note that the scaling in $(6)$ is optional and the general solution is given by $(4)$.