First-half goals from David Norris and Daryl Murphy gave Town a second away win of the season in the Championship.
Norris gave Town an early lead with a deflected shot and Blues had gilt edged openings to extend the lead before Murphy followed up his debut goal at the weekend with a left foot finish eight minutes before the break.
Town dominated the first 45 minutes and could have sealed the win before Jay Simpson got Rangers back in the game midway through the half.
Blues had a few scares at the end but did enough to make it nine games unbeaten against the Londoners and end a run of four matches without a win.
Town boss Roy Keane made four changes to the side that drew with Middlesbrough at the weekend, Jaime Peters and Jack Colback lining up at full-back, with Pablo Counago coming in up front and Owen Garvan in midfield.
Blues were quick out of the blocks again and Gareth McAuley had a header saved by Carl Ikeme before Norris opened the scoring on eight minutes, his shot taking a deflection before beating the 'keeper.
QPR were forced into a change straight after the restart, former Blue Marcus Bent replaced by Rowan Vine. Simpson headed over from close range after good work by Vine, Hogan Ephraim sending a free-kick straight at the wall in a rare period of pressure from the home side in the first-half.
Town should have added a second on 22 minutes when Norris headed at Ikeme from close range, Counago's follow up deflected for a corner.
Alejandro Faurlin was denied by the outstanding Damien Delaney but it was Blues who continued to carve out the best chances, McAuley failing to convert from a corner, Peters' cross then forced behind by Kaspars Gorkss as Counago waited to pounce.
Murphy missed a great chance to make it two but dragged his shot wide from six yards out after a brilliant Jon Walters backheel but the Republic of Ireland international made no mistake on 37 minutes when he blasted in first time from a Colback pass to round off a flowing move.
Matthew Connolly picked up a yellow card for a foul on Counago, Damion Stewart heading over with the last chance of the first-half.
Rangers made two further changes at the break with Adel Taarabt and Akos Buzsaky on for Nigel Quashie and Ephraim.
Ikeme beat away Leadbitter's free-kick at the nearpost, while Town could have sealed the game just past the hour when Grant Leadbitter led a breakaway, setting up Murphy who shot at Ikeme from the angle.
Norris picked up a yellow card for a foul on Taarabt, Town then making a double change with Garvan and Counago replaced by Liam Rosenior and David Healy on 65 minutes but seconds later Rangers were back in the game, Simpson firing in from six yards following a short corner.
Healy couldn't beat the defender with a left foot strike after a Town break, Walters then heading over from a Leadbitter free-kick.
Walters became the second Blue to be booked after pulling back Taarabt as QPR started to exert pressure but Town continued to create openings, Norris failing to convert after a brilliant Healy cross/
As the game entered the last 10 minutes, Arran Lee-Barrett saved from Simpson, Delaney's outstretched leg just doing enough to prevent the danger from another Rangers attack with Lee-Barrett doing well to tip over the resultant corner as Town held out for three vital points.
QPR: Ikeme, Connolly, Stewart, Gorkss, Hill, Cook, Quashie (Buzsaky 46), Faurlin, Ephraim (Taarabt 46), Simpson, Bent (Vine 9). Subs not used: Cerny, Balanta, Borrowdale, German. Booked: Connolly.
Town: Lee-Barrett, Peters, Delaney, McAuley, Colback, Walters, Norris, Leadbitter, Garvan (Rosenior 65), D.Murphy (Stead 85), Counago (Healy 65). Subs not used: B.Murphy, Balkestein,Edwards, Quinn. Booked: Norris, Walters.
Att: 10,940




















