Quadrature Phase Shift Keying (QPSK) is one of the most popular digital modulation techniques. It is widely used in existing technologies because of its spectral efficiency. In this paper, we present a (7, 4) code which can be directly applied on the phase of the QPSK constellation points. The code is based on the fundamental idea of the binary Hamming code. The decoding performance is enhanced by considering the minimum Euclidean distance between the received codeword and all codewords that that can be corrected using the same syndrome. The code can correct all the single symbol errors and 96.3% of double symbol errors at Eb /N0 = 8 dB. By simulation, it is shown that this approach can guarantee a coding gain of 1.5 dB with respect to uncoded QPSK.