Preston had to win and hope that either local rivals Burnley failed to pick up all three points or that Cardiff were defeated at Hillsborough by Sheffield Wednesday to ensure another top six finish for the Whites.
Preston started off edgy with QPR having the ball and playing some nice stuff in midfield. QPR created chances but the scoreline remained blank before a mistake by the visitors let in Preston.
The QPR keeper received th eball from a backpass and his clearance was woeful. So bad that it landed at the feet of Jon Parkin less than 10 yards away. From an acute angle Parkin slotted home to put Preston into the lead.
Heading to half time Whaley missed a simple tap in and Preston were starting to create chances. Results elsewhere at the break were going against them with Burnley leading by two and Cardiff holding on for a draw.
Preston then had a setback at the start of the second half as ex-frontman Patrick Agyemang slotted home past Lonergan to level the scores.
The Whites then piled forward missing various chances that would normally have been put away. News filtered through that Cardiff were behind at Hillsborough and so Preston pushed everything forward in an attempt to seal victory.
That goal came from an unlikely source as the ball was put out for a throw in on the right deep in QPR territory. Jon Parkin grabbed hold of the ball before normal throw in taker Billy Jones could get there. Parkin threw a long throw into the box and St Ledger climbed highest to nod home.
That was not the end of it though as Carter had to clear off the line in the final minute to keep the Whites ahead and send them into the play offs where they will meet Sheffield United this Friday evening at Deepdale before the away leg next Monday.