Changes to support Qt 4.8.1 and 5.2.0