The 23-year-old, who struggled for first-team action at Loftus Road after joining from Harrow Borough in 2010, has been praised by the club's boss Dean Smith.
"I first spotted Troy when he played against us for Bury last season. I've spoken to a few people about him and had some very good feedback," Smith told the club's official website.
"He's been with us since the start of pre-season and has displayed a tremendous attitude and work ethic. He wants to do well and play at the highest level possible."
Hewitt has previously had loan spells with Dagenham & Redbridge, Bury Town and Colchester United.