Goals from Niko Kranjcar, Gary O'Neil and Armand Traore earned QPR a 3-1 win at Ipswich Town in the Championship.