The 31-year-old centre-back, who has 68 caps for the US, has been training with Harry Redknapp's side after leaving his club in Portugal at the end of last season.
"I'm thrilled to get this period over with and finally secure my future," he said.
"QPR are a club with huge ambitions to return to the Premier League and I wanted to be part of it."
Onyewu, who spent time on loan at Newcastle in 2007 and is known as 'Guchi', added: "I had a really good feeling about QPR from the moment I arrived here. I've been welcomed by the club and feel good here.
"I'm looking forward to what will hopefully be a very successful and happy time here.
"This was an opportunity that was presented to me, that I was interested in, and I'm really pleased to be here.
"I want to help the club get back to the Premier League - that's why I've come here.
"Harry believes I can come in and help the team out and when you've got the backing of the coach and his staff, ultimately that tells me that I've made the right decision to come here and try this new challenge.
"England is a fantastic place to play and I can't wait to get started here."