Gareth Ainsworth and Matty Fryatt's first half goals cancelled each other out before the game exploded into life in the second 45 minutes.
Dan Shittu's 82nd-minute equaliser looked to have earned QPR a point after Richard Stearman put Leicester 2-1 up.
But Hughes' 88th-minute effort gave caretaker-boss Rob Kelly victory in his first Championship match in charge.
Leicester's caretaker manager Rob Kelly:
"We let the players make their own decisions and take responsibility for their actions.
"We felt they were going into their shell a little. The pressure has been building so we eased off them."
QPR: Royce, Bignot, Shittu, Santos, Rose, Ainsworth (Donnelly 84), Lomas, Langley, Cook, Furlong (Moore 85), Nygaard (Baidoo 65).
Subs Not Used: Kus, Taylor.
Booked: Rose, Santos.
Goals: Ainsworth 6, Shittu 83.
Leicester: Douglas, Stearman, McCarthy, Kisnorbo, Johansson, Maybury, Williams (Wesolowski 15), Gudjonsson, Hughes, Hume (O'Grady 68), Fryatt.
Subs Not Used: Hammond, Smith, Gerrbrand.
Booked: Johansson, McCarthy, Maybury.
Goals: Fryatt 10, Stearman 79, Hughes 88.
Ref: M Thorpe (Suffolk).