Goals from Mikele Leigertwood and on-loan Arsenal striker Jay Simpson put Rangers in command, and they held on after Nicky Maynard pulled one back for Bristol City.
Simpson's goal - his ninth of the season - brought the game to life after 31 minutes. Fitz Hall crossed from the right and Simpson capitalised on a ricochet off City's Gavin Williams as he steered the ball past keeper Dean Gerken.
QPR went further ahead nine minutes later, when Leigertwood was allowed space near the edge of the penalty area before firing home left-footed from 25 yards.
Rangers keeper Radek Cerny then saved Liam Fontaine's header, leaving City two-down at the break despite them being marginally the better side for most of the first half.
Worse almost followed for the Robins early in the second period, when Simpson raced onto a throughball from Wayne Routledge only to sidefoot wide.
After that lucky escape, City were brought back into the match by a brilliant goal from Nicky Maynard, who collected Gavin Williams' pass before turning and sending an unstoppable volley into the roof of the net.
Rangers substitute Patrick Agyemang volleyed Wayne Routledge's right-wing cross wide of the target, before City appealed in vain for a penalty after Maynard went down under a challenge from Hall.
Defender Hall had another let-off late on, when he gave the ball away in his own penalty area. David Clarkson, on as a substitute for City, could only shoot into the side-netting and Hall's blushes were spared.
QPR's victory was their first in seven matches but did little to quell the frustration of their fans, who vented their anger when Hart brought on defenders Matt Connolly and Gary Borrowdale in the closing minutes.