From Robert Osfield, changed Roni's code to use a #define GETDEVICEPIXELRATIO to access the versioned Qt devicePixelRatio() method to avoid duplication of the Qt version checking.