The defender's king should sit either in front of the pawn or in the corner diagonally opposite to where the pawn is heading. From that corner the defending queen has checks from behind, and the attacking king has no shelter.
In queen-and-pawn versus queen, the location of the defender's king decides whether perpetual check exists. Experience and the tablebases agree on the "drawing zones": for a centre pawn on the fifth or sixth rank, the defending king draws when it stands in front of the pawn or in the corner behind the attacking king, well away from the squares where the attacker could gain a tempo by checking the defender's king and queen on one line.