QPR have announced that they have signed former West Ham midfielder Gary O'Neil on a one-year contract.