Replace Qt functions deprecated in 5.0