Let $q<Q$ be such that all its prime divisors are in $A$. We can write $q=q_0\times r_1^{n_1}\cdots r_s^{n_s}$, where all prime factors of $q_0$ are $<\log Q$ and $\log Q\leq r_1<\cdots<r_s\in A$. Clearly, $q$ is uniquely determined once we have fixed a) $q_0$, b) the set $\{r_1,\ldots,r_s\}$, and c) the integer vector $(n_1,\ldots,n_s)$.
The number of possible $q_0$ is at most the number of $q<Q$ which have all prime factors $<\log Q$. This is a well-studied quantity in analytic number theory (counting 'smooth' or 'friable' numbers), and is $\leq \exp(O(\log Q/\log\log Q))$, which can be shown via elementary methods, see any textbook on analytic number theory.
There are clearly at most $d(n,Q)$ choices for the set $\{r_1,\ldots,r_k\}$.
Finally, to estimate the number of choices for (c), note that
$$\sum n_i\log r_i < \log Q,$$
and $\log r_i\gg \log \log Q$ by construction, hence it suffices to bound the number of positive integers $n_1,\ldots,n_s\geq 1$ (where $s$ may vary) such that $\sum n_i \ll \log Q/\log\log Q$. This is at most $\exp(O(\log Q/\log\log Q))$, using the elementary fact (simple combinatorics, 'stars and bars') that the the number of sequences of positive integers $n_i$ with $\sum n_i \leq M$ is exactly $2^M$.
Thus combining these three estimates, the number of possible $q$ is at most
$$ (\exp(O(\log Q/\log\log Q)))^2\times d(n,Q) \ll \exp(O(\log Q/\log\log Q))d(n,Q).$$