QPR have struck a deal with one eye on the future, with teenage defender Sam Magri snapped up from Portsmouth on a two-year deal.