Ainsworth was told by Lennie Lawrence that he could not guarantee him a contract for next season.
There was talk of Walsall maybe coming in with a late bid for the 30 year old winger but QPR Club Secreatary Sheila Marson told the QPR official website.
"He has agreed in writing to join and enjoyed a successful medical towards the end of last week" Marson said this afternoon. "He is now due to go for an MRI scan on Wednesday (25th) and should all go as planned he will put pen to paper on July 1st. The signing cannot take place any sooner, as the player is contracted to Cardiff City until June 30th."