Let $a, b \in\mathbb{Z}$
The roots of the equation $x^2 - px+q=0$ are $a + b = p$ and $ab = q$. So $a, b > 0$ Hence $(a-1)(b-1)\geq0$ So $(p-q+1)\geq0$
Similarly, from the second equation $q-p+1\geq1$, hence $(p-q)\in(-1,0,1)$
Cases
If $p = q$, the equation $x^2 - px+p=0$ has integer solutions. So $D=p^2-4p$ needs to be a perfect square. But $p^2-4p=k^2$ implies $(p-2-k)(p-2+k)=4$. $(p-2-k)$ and $(p-2+k)$ have the same parity,so only possibility is $p-2-k= p-2+k=2$.Hence $p=4$. For $p=4$ the solutions of $x^2-px+p=0$ are both equal to $2$...integers.
If $p = q + 1$, the equation $x^2-px+q= 0$ has the integer solutions $1$ and $q$. The equations $x^2 - qx+p=0$ becomes $x^2-qx+q+1=0$ must have have integer solutions. Now $D=q^2 - 4q-4=k^2$ implies $(q-2-k)(q-2+k)=8$ implies $(q-2-k) =2$ and $(q-2+k) =4$ Hence $q = 5$
$(p, q) = (6, 5)$ which satisfies the condition.
Similarly, if $(p-q) =-1$ $(p, q) = (5, 6)$
Solutions are $(p, q)=(6, 5),(5,6),(4,4)$