Mackie, 27, made 29 appearances for the west London club last season but scored just two goals as QPR were relegated to the Championship.
He requested to leave earlier this week in order to find more regular football, having found himself in and out of the side following Harry Redknapp's arrival in November.
Forest boss manager Billy Davies told the club's official website: "Jamie is an excellent signing for us.
"His athleticism and work rate are second to none and his ability to play out wide will add real diversity and direction to our attacking play.
"Those factors, added to his considerable domestic and international experience, make him an extremely valuable addition to our squad."
It is the second piece of business finalised by Forest boss Billy Davies after Algeria winger Djamel Abdoun arrived from Greek champions Olympiacos for an undisclosed fee.
Abdoun, capped 11 times by his country, also signed a three-year deal at the City Ground and joined summer arrival Jamie Paterson, from Walsall, in bolstering Davies' squad.