Cardiff have started 2018 with defeat, a fourth in a row, after throwing away a lead at Loftus Rd.
Joe Ralls opened the scoring from the penalty spot in the 54th minuite to give City a lead but that lasted only 8 minutes before Matt Smith headed Rangers level.
The home side went into the lead on 72 mins when Paul Smyth skipped into the box and saw his shot deflect over the City keeper into the goal.
Cardiff thought they had levelled in the last ten minutes when Junior Hoilett scored but the officials made a has of it and ruled out a perfectly good goal for offside despite the ball being played to Hoilett from a QPR player.
Neil Warnock's decision to change the keeper and drop Mendez-Laing and Tomlin ended up fruitless as City suffer another defeat.
Even so City are still in the hunt for 2nd place but the points cushion we did have has been absorbed and now the sides below us in the play off places are closing in.
Before Bristol City play at Villa Cardiff are 4th, 2 points behind 2nd place Derby (who drew with Shef Utd) and level on points with 3rd place Bristol.
It's the FA Cup next before City have back to back Sky TV games at home to Sunderland and away to Sheff Weds. Both of those teams suffered pathetic defeats today. So Cardiff must have hope that this slump will end sooner rather than later.