This is not the only possible answer. The card could be 4 of Spades. Q knows because it is the only duplicate in the suit he has seen. He knows that P doesn't yet know because he knows it is a 4 and there is more than one 4. P knows once Q has told him he knows because Spades is the only suit where the 4 is the only possiblity.