Matty Fryatt, who scored both their goals to take his tally for the season to ten, punished a dreadful mistake by the Czech goalkeeper to net a second-half winner.
Cerny's horribly miscued kick fell straight to the striker, who calmly slotted the ball past him and into the corner of the net.
QPR had gone ahead in the 33rd minute through Adel Taarabt's third goal in four matches.
The Moroccan found space midway through the Leicester half and played the ball towards Jay Simpson. When Simpson was tackled, Taarabt pounced on the loose ball and fired home from 20 yards.
Taarabt had caused Leicester problems throughout the first half-an-hour, sending one effort wide and another over the bar.
Wayne Routledge had also gone close for Rangers early on, collecting Akos Buzsaky's pass and spinning away from Jack Hobbs before shooting wide.
Alejandro Faurlin's free-kick was well saved by Leicester keeper Chris Weale, but the visitors also had chances before going behind.
- Football League Championship Results
- Football League Championship Table
A mistake by defender Damion Stewart let in Leicester forward Martin Waghorn, who shot straight at Cerny.
And when Waghorn did find the net from Dany N'Guessan's low cross, he was denied by an offside flag.
After Taarabt's excellent strike, Leicester hit back when N'Guessan crossed from the left and Fryatt sneaked behind Stewart to head in the equaliser.
More good work on the left by N'Guessan almost led to a goal early in the second half. Again the Frenchman served up a dangerous cross, but this time an unmarked Waghorn was just unable to connect.
Leicester continued to press, but in the end the decisive goal was the result of a gift from Cerny.
Rangers missed a late chance to equalise when Routledge teed up Buzsaky, who blasted over.
Queens Park Rangers v Leicester City: As it happened