I made a comment earlier, but let me try converting it to an answer. It's similar in flavor to Ivan's.
By a back and forth argument, all countable dense subsets of $\mathbb{R}$ are homeomorphic to $\mathbb{Q}$, which allows one to replace $\mathbb{Q}$ with the space of quadratic irrationals, which I'll denote by $Q'$. The (regular) continued fraction expansions of elements of $Q'$ are precisely infinite continued fractions that are eventually periodic. By taking continued fractions, we have a homeomorphism $\mathbb{Z} \times \mathbb{N}^\mathbb{N} \cong \mathbb{P}$ defined by
$$(a_0, a_1, a_2, \ldots) \mapsto a_0 + \frac1{a_1 + \frac1{a_2 + \ldots}}$$
and from there we easily get a homeomorphism $\mathbb{N}^\mathbb{N} \cong \mathbb{P}$. Since $\mathbb{N}^\mathbb{N}$ is homeomorphic to its square via the interleaving map
$$((a_0, a_2, \ldots), (a_1, a_3, \ldots)) \mapsto (a_0, a_1, a_2, a_3, \ldots)$$
we get a homeomorphism $\mathbb{P} \times \mathbb{P} \to \mathbb{P}$ by interleaving continued fractions. The subset $Q' \times \mathbb{P}$ maps homeomorphically onto its image under this map, and this image is of course dense (it contains for example the dense set $Q'$ of numbers with eventually periodic cf's).